Skip to content

Commit 0168411

Browse files
authored
fix(awc): close connections after GO_AWAY local or remote GO_AWAY errors (#3790)
1 parent fde7934 commit 0168411

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

awc/CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Fix a bug where `GO_AWAY` errors did not stop connections from returning to the pool.
6+
57
## 3.8.0
68

79
- Add `hickory-dns` crate feature (off-by-default).

awc/src/client/h2proto.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ where
107107

108108
let res = poll_fn(|cx| io.poll_ready(cx)).await;
109109
if let Err(err) = res {
110-
io.on_release(err.is_io());
110+
io.on_release(err.is_io() || err.is_go_away());
111111
return Err(SendRequestError::from(err));
112112
}
113113

@@ -121,7 +121,7 @@ where
121121
fut.await.map_err(SendRequestError::from)?
122122
}
123123
Err(err) => {
124-
io.on_release(err.is_io());
124+
io.on_release(err.is_io() || err.is_go_away());
125125
return Err(err.into());
126126
}
127127
};

0 commit comments

Comments
 (0)