fix(awc): close connections after GO_AWAY local or remote GO_AWAY errors

This commit is contained in:
Kevin Logan 2025-10-01 09:50:03 +01:00
parent 429ff82a4b
commit b4108c7ce6
2 changed files with 4 additions and 2 deletions

View File

@ -2,6 +2,8 @@
## Unreleased ## Unreleased
- Fix a bug where `GO_AWAY` errors did not stop connections from returning to the pool.
## 3.8.0 ## 3.8.0
- Add `hickory-dns` crate feature (off-by-default). - Add `hickory-dns` crate feature (off-by-default).

View File

@ -107,7 +107,7 @@ where
let res = poll_fn(|cx| io.poll_ready(cx)).await; let res = poll_fn(|cx| io.poll_ready(cx)).await;
if let Err(err) = res { 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)); return Err(SendRequestError::from(err));
} }
@ -121,7 +121,7 @@ where
fut.await.map_err(SendRequestError::from)? fut.await.map_err(SendRequestError::from)?
} }
Err(err) => { Err(err) => {
io.on_release(err.is_io()); io.on_release(err.is_io() || err.is_go_away());
return Err(err.into()); return Err(err.into());
} }
}; };