Skip to content

FFI: fix deadlock in hyper_executor::poll_next#3370

Merged
seanmonstar merged 1 commit intohyperium:masterfrom
jsha:unlock-deadlock
Oct 23, 2023
Merged

FFI: fix deadlock in hyper_executor::poll_next#3370
seanmonstar merged 1 commit intohyperium:masterfrom
jsha:unlock-deadlock

Conversation

@jsha
Copy link
Copy Markdown
Contributor

@jsha jsha commented Oct 23, 2023

poll_next locks the driver, and also calls drain_queue while holding that lock. Since drain_queue locks the driver too, that results in a deadlock.

To fix, unlock the driver before calling drain_queue.

Fixes #3369.

@seanmonstar
Copy link
Copy Markdown
Member

The fix looks great, thanks! Seems CI is grumpy about a missing comma, of course.

poll_next locks the driver, and also calls drain_queue while holding
that lock. Since drain_queue locks the driver too, that results in a
deadlock.

To fix, unlock the driver before calling drain_queue.
@seanmonstar seanmonstar merged commit 0c7d03e into hyperium:master Oct 23, 2023
@jsha jsha deleted the unlock-deadlock branch October 23, 2023 19:59
0xE282B0 pushed a commit to 0xE282B0/hyper that referenced this pull request Jan 12, 2024
poll_next locks the driver, and also calls drain_queue while holding
that lock. Since drain_queue locks the driver too, that results in a
deadlock.

To fix, unlock the driver before calling drain_queue.

Closes hyperium#3369
0xE282B0 pushed a commit to 0xE282B0/hyper that referenced this pull request Jan 16, 2024
poll_next locks the driver, and also calls drain_queue while holding
that lock. Since drain_queue locks the driver too, that results in a
deadlock.

To fix, unlock the driver before calling drain_queue.

Closes hyperium#3369

Signed-off-by: Sven Pfennig <s.pfennig@reply.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C API deadlock in hyper_executor::poll_next

3 participants