From 016841137edc13a5ec8cada4a21f0162842962c4 Mon Sep 17 00:00:00 2001 From: Kevin Logan <36521330+kevin-logan@users.noreply.github.com> Date: Sat, 4 Oct 2025 18:44:02 -0600 Subject: [PATCH] fix(awc): close connections after GO_AWAY local or remote GO_AWAY errors (#3790) --- awc/CHANGES.md | 2 ++ awc/src/client/h2proto.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/awc/CHANGES.md b/awc/CHANGES.md index abeb9d5c5..ee18a0809 100644 --- a/awc/CHANGES.md +++ b/awc/CHANGES.md @@ -2,6 +2,8 @@ ## Unreleased +- Fix a bug where `GO_AWAY` errors did not stop connections from returning to the pool. + ## 3.8.0 - Add `hickory-dns` crate feature (off-by-default). diff --git a/awc/src/client/h2proto.rs b/awc/src/client/h2proto.rs index f12ac3b43..2e0da2e4f 100644 --- a/awc/src/client/h2proto.rs +++ b/awc/src/client/h2proto.rs @@ -107,7 +107,7 @@ where let res = poll_fn(|cx| io.poll_ready(cx)).await; if let Err(err) = res { - io.on_release(err.is_io()); + io.on_release(err.is_io() || err.is_go_away()); return Err(SendRequestError::from(err)); } @@ -121,7 +121,7 @@ where fut.await.map_err(SendRequestError::from)? } Err(err) => { - io.on_release(err.is_io()); + io.on_release(err.is_io() || err.is_go_away()); return Err(err.into()); } };