我们有AWS数据管道,我们有一个活动(python脚本),它从/向s3桶读取/写入数据。我们最近注意到,由于关闭套接字连接,s3读取失败的活动失败。错误是间歇性的。失败恰好发生在脚本的同一行。
read_buff = key_file.read(1024)
File "/usr/lib/python2.7/site-packages/boto/s3/keyfile.py", line 89, in read
return self.key.read(size)
File "/usr/lib/python2.7/site-packages/boto/s3/key.py", line 373, in read
data = self.resp.read(size)
File "/usr/lib/python2.7/site-packages/boto/connection.py", line 414, in read
return httplib.HTTPResponse.read(self, amt):
File "/usr/lib64/python2.7/httplib.py", line 561, in read
s = self.fp.read(amt)
File "/usr/lib64/python2.7/socket.py", line 380, in read
data = self._sock.recv(left)
File "/usr/lib64/python2.7/ssl.py", line 241, in recv
return self.read(buflen)
File "/usr/lib64/python2.7/ssl.py", line 160, in read
return self._sslobj.read(len)
error: [Errno 104] Connection reset by peer
在我们的代码中,我们以1KB的块读取s3中的数据。失败发生在从s3中的文件读取的过程中。有谁知道从EC2实例到s3存储桶允许的连接数是否有上限?