-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
Strange crash: KeyError while trying to 'del runner.deadlines[...]' on a cancel scope with -inf deadline #837
Comments
😕 yeah that's not supposed to happen. Let's see if we can track it down. Fortunately the traceback contains a lot of information. The relevant part is this:
I think what it's saying is:
So, the first questions that come to mind are:
|
I downloaded your code and trio_websocket and looked for red flags. The only suspicious thing I found was that your code appears to create a websocket connection in one call to trio.run() and try to close it in another call:
In general, different calls to trio.run() are in different universes and it won't work to share state between them. I wasn't able to reconstruct a story for how you could get this specific error by doing that, but it's a thing to look out for. Also from your code it looked like maybe it was possible to call close() from inside the start() loop? i.e., a run() inside a run(). That won't work either, but trio.run() is supposed to have a check for that which provides a useful error. Unless there are threads (real OS threads, not trio tasks) somewhere that I'm missing -- each thread can have its own run(), and trying to use the same websocket connection from multiple threads simultaneously could explain the behavior you're seeing. Thanks for the bug report, and sorry not to be able to provide a more definitive answer! |
Thanks! I might be doing a lot of things wrong with trio I don't know about. To answer some questions:
I think I ran it using PyCharms's debugger. Could that have caused issues? |
You've pinned a very old version of trio_websocket in your requirements. Update it and see if the issue stays? |
Will do, didn't realize it was old. |
Oh, nice catch. But I don't see any mention of |
Closing since I don't see how we could realistically make progress on this with the information we have, and the multiple calls to trio.run() create lots of opportunity for some unexpected and unsupported interaction. Feel free to reopen if it reoccurs. |
(To be clear in case anyone stumbles across this from a search engine years from now: Doing multiple calls to |
What's the issue
Trio, after a long period of time, will stop working and raise an internal error.
Steps to reproduce
Traceback (It's a long one)
Expected Result
The program should continue running, displaying the output such as the first 2 lines provided in the traceback.
The text was updated successfully, but these errors were encountered: