-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error [ERR_HTTP2_INVALID_SESSION]: The session has been destroyed #88
Comments
We're experiencing the same issue. We're using I can reproduce the problem by sending the same request in an endless loop in certain intervals (e.g. every 5 seconds), something like const { fetch, disconnectAll } = require('fetch-h2');
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const url = '<some http/2 server url>';
const main = async () => {
let cnt = 1;
let errCnt = 0;
const MAX_ERRORS = 10;
while (true) {
console.log(`iteration #${cnt++}, ts: ${new Date().toISOString().slice(11, 23)} UTC`);
try {
const resp = await fetch(url);
console.log(`status: ${resp.status}, httpVersion: ${resp.httpVersion}`);
const data = await resp.text();
console.log(`response body: ${data}\n\n`);
} catch (err) {
errCnt++;
console.log(`caught error #${errCnt}: ${err}`);
console.error(err);
if (errCnt > MAX_ERRORS) {
console.log('rethrowing ...');
throw err;
}
}
await sleep(5000);
}
};
main().then(() => {
console.log('cleaning up...');
return disconnectAll();
}).catch((err) => {
console.log(`caught error: ${err}`);
console.error(err);
}); After some time (usually a couple of hours) we're seeing first an
The problem seems to be that the cached http2 session in |
is this problem solved? I met the same error. |
I've got a long-running node application that occasionally makes a flurry of requests to an AWS server. If the application has been sitting dormant for a few minutes, and then makes a request, the application crashes with an error:
Using
fetch-h2
2.4.0 with NodeJS v12.15.0. At this stage I'm not sure if the crash is avoidable or not - I'll see if I can create a simple repro of the issue.The text was updated successfully, but these errors were encountered: