-
Notifications
You must be signed in to change notification settings - Fork 653
Deadlock issue in futures/tokio? #1170
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
Comments
Interesting! I think this belongs as an issue on https://github.com/tokio-rs/tokio, though, since the |
@cramertj From the stack trace, its blocked waiting for the Receiver side of a |
@jsgf If you suspect there's a bug in |
In this case the code is from
We're blocked in What are the threadpool and reactor thread lifetimes? Would the exit if there's nothing that needs them? That means that in the
So my initial reaction is that this looks like a lost wakeup - the code spawned into the executor completed normally, but the I attached to the process with gdb and tried to poke around to see if I could fine the It could be a bug in |
I've been seeing something potentially related recently as well. We have a synchronous HTTP client built on top of tokio/hyper. There's a tokio Runtime running in the background, and we spawn off HTTP requests with mpsc::spawn and then .wait() on them to provide the blocking interface. Recently we've seen the client getting into a bad state where all requests block forever. The synchronous bit is waiting on the oneshot channel in pthread_cond_wait, and the runtime threads are idle. I'm going to try to make a smaller reproduction this weekend. My gut says that this is probably a tokio issue rather than futures though, yeah. |
We just ran into the issue again. I can collect necessary info for debugging |
Frame #4 of the stack trace above is in ThreadNotify::park() method. So in gdb I did
and it showed that |
Hm, it would be really nice to see what state the oneshot itself is in then. Does it think it has notified? Edit: Well at least SLEEP is completely consistent with being asleep on the condvar, and at first glance all the logic around park/notify looks sound. |
We downgraded to tokio-threadpool 0.1.4 and that seems like it may have fixed things for us - might be worth trying that on your end as well? |
Closing as stale |
Flagging the issue that we've ran into recently. We have a binary that waits for a future to complete via
Runtime::block_on()
- https://goo.gl/tmVfCU, and from time to time it waits forever. From the logs it was clear that the future has actually completed, but thisRuntime::block_on()
method never exits.Below is the stacktrace. What was interesting is that there was just one thread running when we've noticed the deadlock.
Has anybody ran into similar issues?
The text was updated successfully, but these errors were encountered: