From 268fb2d1004b80dbb9af8b4ffcdb04fc3a2df93d Mon Sep 17 00:00:00 2001 From: yanyuxing Date: Sat, 7 Jun 2025 15:14:25 +0800 Subject: [PATCH] fix(actix-http): wake before return pending when read half disconnect and need to shutdown --- actix-http/src/h1/dispatcher.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/actix-http/src/h1/dispatcher.rs b/actix-http/src/h1/dispatcher.rs index 00b51360e..3f0b78af4 100644 --- a/actix-http/src/h1/dispatcher.rs +++ b/actix-http/src/h1/dispatcher.rs @@ -1182,7 +1182,7 @@ where let state_is_none = inner_p.state.is_none(); // read half is closed; we do not process any responses - if inner_p.flags.contains(Flags::READ_DISCONNECT) && state_is_none { + if inner_p.flags.contains(Flags::READ_DISCONNECT) { trace!("read half closed; start shutdown"); inner_p.flags.insert(Flags::SHUTDOWN); } @@ -1216,6 +1216,9 @@ where inner_p.shutdown_timer, ); + if inner_p.flags.contains(Flags::SHUTDOWN) { + cx.waker().wake_by_ref(); + } Poll::Pending };