-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
SimpleAsyncHTTPClient randomly blocking on "ValueError: IOStream is not idle; cannot convert to SSL" #2546
Comments
Hmm, I haven't seen anything like that and I'm not sure how it could happen. Are you doing anything with multiple threads, by any chance? You're not supposed to call
I don't think that could break anything like this, though. |
No multiple threads with my tornado process. I have a couple of celery Good catch for the |
Yes, eventlet could be the problem. Tornado is incompatible with the monkey-patching features of eventlet and greenlet. You can use these libraries in the same process as Tornado only if you avoid their monkey-patching features, but it looks like celery in eventlet mode uses monkey patching |
So even though the processes are completely separate (tornado vs celery eventlet worker), celery patches still apply to the tornado process? |
In a separate process it's fine. I misunderstood and thought you were running the celery workers inside the tornado process. |
We ran into something similar today:
Anything I can share with you that would help you investigate? |
Some more data. HerokuWe run Tornado on Heroku using
SentryWe saw 3 exceptions spike in Sentry
|
Which Tornado and Python versions? (Tornado 6 silences the "errno 0" log messages) Are you still using that monitoring package that does a lot of monkey-patching? (which one was it again?) As far as I know the errno 0 thing is just harmless log spam (it's supposed to be an What's the stack trace for the "iostream not idle" message? Do the client timeouts happen on particular URLs or domains? |
Hi Ben, long time no see! 👋🏻
We see occasional timeouts when rendering large PDFs (which is not surprising). However, there were no PDF request to that instance around the time this started. The whole instance locked up, ramping up to almost 100% timeouts and only recovering after 40 minutes. One explanation for that would be that it just fell behind, and then the queued up requests all timed out in succession until the request pattern allowed it to catch up. However, that wouldn't explain the spike in both the SSL and IOstream errors. Below is the stack trace for the IOStream error. I can give you access to Sentry too if that'd be helpful:
|
Hi Nick! The fact that you're seeing "errno 0" in Tornado 6 means that it's getting raised in a different spot than I've seen before (it's not caught by e63980f). Do you have the stack trace for that one? I'm suspicious that this is related to some issues related to TLS 1.3 that we haven't tracked down yet (#2536). Disabling TLS 1.3 (like #2725) might prevent this. Did CPU utilization go to 100% during this? If it happens again it would be great to get a profile (thinking of https://github.com/bdarnell/plop or https://github.com/nylas/nylas-perftools but neither has been updated in a long time so I'm not sure if there's something more current). |
I do have a stack trace!
Since we're on Heroku, I have limited visibility into CPU utilization, but I did not see a spike in "dyno load". It hasn't happened again, but I'll take a look at those profiling tools. |
Hi, I'm using
SimpleAsyncHTTPClient
to perform a few hundred requests per minute. It has been working fine until I started encountering the error below. This error happens randomly (I didn't manage to replicate it) and once it occurs, theSimpleAsyncHTTPClient
fails on all his following requests (Timeout while connecting
). A process restart solves the problem until the error occurs again. Any idea where this comes from or how to handle it?I tried catching it and managed to close the client and create a new instance, but it still can't perform HTTP requests until the program is restarted.
I'm using tornado 5.1.1 on Python 2.7.15 and here's a snippet of how I initialize the HTTPClient:
The text was updated successfully, but these errors were encountered: