Broken Pipe exceptions raised after idle periods
See original GitHub issueI’m using long-lived client objects like so:
client = discovery.build(....)
task = client.get_something(....).execute(num_retries=5)
some_long_running_process(task)
client.do_another_thing().execute(num_retries=5)
And running into exceptions on the calls to do_another_thing()
:
Traceback (most recent call last):
File "/opt/app/gcp_helper.py", line 168, in get_size
instanceGroupManager=instance_group).execute(num_retries=5)
File "/opt/venv/local/lib/python2.7/site-packages/oauth2client/util.py", line 137, in positional_wrapper
return wrapped(*args, **kwargs)
File "/opt/venv/local/lib/python2.7/site-packages/googleapiclient/http.py", line 755, in execute
method=str(self.method), body=self.body, headers=self.headers)
File "/opt/venv/local/lib/python2.7/site-packages/googleapiclient/http.py", line 93, in _retry_request
resp, content = http.request(uri, method, *args, **kwargs)
File "/opt/venv/local/lib/python2.7/site-packages/oauth2client/client.py", line 633, in new_request
self._refresh(request_orig)
File "/opt/venv/local/lib/python2.7/site-packages/oauth2client/contrib/gce.py", line 129, in _refresh
META, headers={'Metadata-Flavor': 'Google'})
File "/opt/venv/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1609, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/opt/venv/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1351, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/opt/venv/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1273, in _conn_request
conn.request(method, request_uri, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1001, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1035, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 997, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 850, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 826, in send
self.sock.sendall(data)
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
error: [Errno 32] Broken pipe"
I would expect the num_retries argument to handle these exceptions in https://github.com/google/google-api-python-client/blob/master/googleapiclient/http.py#L145, but for the time being I have to implement my own retry logic around all API calls to overcome this.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:48 (16 by maintainers)
Top Results From Across the Web
Broken Pipe - Socket Exception - with latest version of Hibernate
Looks like this issue is happening if the application has no activity with the database for a considerable amount of time (say 12...
Read more >java.net.SocketException: Broken pipe in WSA after two hours ...
The exception is only thrown after a two hour time period between calls to the WSA. Error Message. DISCONNECT IOException: java.net.
Read more >How to Fix java.net.SocketException: Broken pipe in ... - Java67
These broken pipe exceptions happen when the client (browser) has closed the connection, but the server (your tag) continues to try to write...
Read more >CPE3455 - Broken Pipe in DDM, DRDA clients - IBM
DDM and DRDA client applications which have significant periods where communication is idle may receive a CPE3455 "Broken pipe" error when ...
Read more >Frequent java.io.IOException: broken pipe messages ... - Jira
Our findings show that this exception is a symptom rather than a cause. ... This can happen as well with anything that is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m experiencing this issue as well…
Using:
Python 3.6.7
Stack trace:
It’s something that happens now and then, not super common. Constantly recurring though.
As an example in a sample of 7,741,334 publishes I have 6 of those errors.
@Bobspadger probably not, but we’re soon replacing oauth2client in this library with google-auth, which will allow us to use urllib3 and requests without needing httplib2shim.