-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workers not timing out when requests.get hangs #1655
Comments
That is very strange. With the Also, the I am not sure where to start debugging, beyond sharing that context. |
I've been dealing with this for a long time. I initially thought it might have been a memory issue but doubling the memory does nothing to help. I'm not sure how to better debug this as I can't reproduce it on my local system. It only ever happens when a requests exception is thrown. It doesn't have to be the |
Could this be anything like #588? |
Here's a simple application I am using to try to reproduce the problem. I cannot. import requests
s = requests.session()
def application(environ, start_response):
try:
return s.get('http://httpbin.org/delay/5', timeout=3)
except:
start_response('502 Bad Gateway', {})
return iter([])
start_response('200 OK', {})
return iter([b'Hello']) I start with Can you provide a simple example that reproduces the problem, maybe in a repo? Do you experience it locally, or only on App Engine? |
Sorry that’s not clear for me. By no requests served you mean that no other requests using different endpoints were also returning? |
I have to apologise for the slow reply. I'll have some time to try and replicate this more reliably over my xmas break. @benoitc It completely hangs, then eventually serves 502s after the exception is raised or until (very occasionally) Google Cloud's health checks timeout at 3 minutes. It does look similar to #588 in some ways. I'll be completely free after the 19th to investigate this fully. |
Ohh sorry also @tilgovi
I don't know how to reproduce exceptions like that currently which has been my main struggle in reproducing this locally. |
I was never able to reproduce it locally. This week after the following changes:
It is all working fine. So it almost certainly wasn't gunicorn. |
I'll close this issue, but feel free to re-open if you track down any issues. |
I'm making calls to an API and multiple times a day requests.get hangs then throws
'Remote end closed connection without response'
after 1-2 minutes even with the timeout set to 40 seconds. The workers all hang until the exception is thrown. Nothing in the logs until[CRITICAL] WORKER TIMEOUT
after the exception.Expected Result
I would expect it to timeout after 40 seconds.
Actual Result (from logs)
No requests served for 1:55 minutes then all workers time out.
Time elapsed (hh:mm:ss.ms) 0:01:55.254653
[CRITICAL] WORKER TIMEOUT
Reproduction Steps
gunicorn.conf.py
app.yaml
System Information
Python 3.6.3
Google App Engine Flexible
The text was updated successfully, but these errors were encountered: