googleapis / googleapis/google-api-nodejs-client

How to handle HTTP/2 GOAWAY events / errors

Open
#3,126 0 comments 8 reactions 0 assignees View on GitHub
priority: p3 type: question
Dominant language
TypeScript
Stars
12.2k
Forks
2k
Avg merge
1d 9h
Merged PRs (30d)
24

Description

We have code that connects to gmail using http/2 using node16.
From time to time we will receive an HTTP/2 GOAWAY message which results in an error occurring.
I cannot see from the documentation or the exported types any obvious way to hook into handling this event but what I would like to be able to do is monitor this event and handle it appropriately. The other option would be for the library to intercept and handle this event in the internal library way, I suppose.

```
Error [ERR_HTTP2_GOAWAY_SESSION]: New streams cannot be created after receiving a GOAWAY
at new NodeError (node:internal/errors:371:5)
at ClientHttp2Stream.requestOnConnect (node:internal/http2/core:696:17)
at node:internal/http2/core:1812:68
at Array.forEach ()
at ClientHttp2Session. (node:internal/http2/core:1812:11)
at Object.onceWrapper (node:events:646:26)
at ClientHttp2Session.emit (node:events:538:35)
at ClientHttp2Session.emit (node:domain:475:12)
at emit (node:internal/http2/core:328:3)
at processTicksAndRejections (node:internal/process/task_queues:85:21)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.