Apparent deadlock with Expect: 100-continue #2994
Labels
B-upstream
Blocked: needs a change in a dependency or the compiler.
C-bug
Category: bug. Something is wrong. This is bad!
Version
Hyper 0.14.20
Platform
Linux dis 5.19.0-1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.19.6-1 (2022-09-01) x86_64 GNU/Linux
Debian amd64/sid
Description
When making a curl request with
Expect: 100-continue
, there is a deadlock where there is not without that.Cargo.toml
:Code (
src/main.rs
):I ran
curl -v http://github.localhost:3000/ -d0000
andcurl -v http://github.localhost:3000/ -d0000 -H'Expect: 100-continue'
.I expected to see this happen:
I expected both requests to complete nearly instantly.
Instead, this happened:
The request with
Expect: 100-continue
hangs and the other one succeeds. A100 Continue
response is not sent. All similar requests that do not containExpect: 100-continue
succeed, regardless of method or presence or lack of a body. All requests without a body succeed.A note that the
block_on_async
function seems to be relevant and I wasn't able to reproduce without it. I've instrumented my real code and it appears that code blocks awaiting inbody.data().await
. From the issues I've read, it seems that polling the body should cause the100 Continue
response to be sent (and it is not), and I suspect that that is related to why this triggers here. I don't believe the runtime should be unable to progress because there should be sufficient worker threads and thetokio::task::block_in_place
should not block the executor. I have sufficient cores that the number of worker threads should be sufficient to progress, and gdb indicates that my real code is blocked on anepoll
and the other executor threads are idle.If there's any more information I can help provide here, please let me know, and I'll be happy to do so.
The text was updated successfully, but these errors were encountered: