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()); } };