Best way of handling H2 GOAWAY disconnect errors in a Pool? #4121
-
Hi everyone, We're using a Pool against an ALB and occasionally we are seeing H2 GOAWAY disconnect errors. What seems to work is to re-emit a 'connectionError' event to the Agent (Pool) which triggers the erroring target(s) to be removed from the pool. However, maybe removing targets on GOAWAY errors should be the default behavior? The docs allude to doing this but I can't find any examples of it. So this is what we are doing: agent.on(
'disconnect',
(origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => {
if (error?.message) {
if (this.isGoAwayError(error)) {
// re-emit this as a connection error so the target is removed from the pool
agent.emit('connectionError', origin, targets, error);
} else {
log.debug('Disconnected from %s with error: %s', origin, error.message);
}
} else {
log.debug('Disconnected from %s ', origin);
}
}
); |
Beta Was this translation helpful? Give feedback.
Answered by
metcoder95
Mar 28, 2025
Replies: 1 comment
-
Opened a PR to address it #4123 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dhalbrook
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Opened a PR to address it #4123