-
Notifications
You must be signed in to change notification settings - Fork 545
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
assert(!this.aborted)
triggers sporadically when allowH2
is set to true
#2808
Comments
Having an early assessment it seems this might have to be with the streams handling for H2; I'll try to dig into later Today or Tomorrow, have an idea where to look at |
Hi @metcoder95, thanks a lot for your work on the repo. Have you found the cause of the issue? This issue is affecting my workloads as well. I also wanted to chip in that the trigger of this bug reminds me of nodejs/node#47130 which affected Keep-Alive http/1.1 requests. (There is a workaround in that thread involving undici with Keep-Alive hints, but from my personal experience if the server kills the TCP connection without providing the Keep-Alive hints, undici is vulnerable to the same bug as node-fetch) |
👋 No, sadly I've had the time, but the issue you shared with me resembles, especially because we reuse the socket for the HTTP/2 session, meaning that if the Node.js implementation suffers from that, most likely ours will do as well; here the trick will be to try to reproduce it by disabling But without any doubt, thanks for the contexts, that's pretty valuable |
Same problem for me import { fetch, Agent } from "undici";
const agent = new Agent({ allowH2: true, connect: { keepAlive: false } });
const exec = () => {
setInterval(async () => {
const now = Date.now();
try {
const response = await fetch("https://http2.pro/api/v1", {
dispatcher: agent,
keepalive: false
});
await response.text();
console.log(response.status);
} catch (e) {
console.error(e);
}
console.log(Date.now() - now)
}, 1);
}
exec(); is quite annoying as I cannot use fetch as I would like and the script terminates without going into catch. With http 1.1 this does not happen Node.js v20.11.1 EDIT:Tried also with undici 6.10.1 AND/OR Nodejs 21.7.1 problem still persist:
It seems that onData in client-h2.js is called before onHeaders (or onHeaders is never called) and the body is not initialized as Readable instance in fetch/index.js @metcoder95 Do you have any idea/advices ? |
@metcoder95 only one question (not related to this "bug", but for the same script),
and before this i get lot of frameerrors
and then
Is this behaviour intentional or is it a bug? |
For the third error, I'm not sure how did you trigger that; tried with your script without luck |
try this one: import { fetch, Agent } from "undici";
const agent = new Agent({ allowH2: true, connect: { keepAlive: false } });
const exec = () => {
setInterval(async () => {
//const now = Date.now();
try {
const response = await fetch("https://www.amazon.in/dram/renderLazyLoaded", {
dispatcher: agent,
keepalive: false
});
await response.text();
//console.log(response.status);
} catch (e) {
console.error(e);
}
//console.log(Date.now() - now)
}, 1);
}
exec(); Consider that i have 15 mb/s download and 1 mb/s upload (I'm not sure at 100% is a network problem, I'm supposing)
First i reach session onHTTP2GoAway with code 0 at timestamp 1711540592412 |
I'm pretty much sure you're suffering from congestion control due to limited bandwidth, I'm running it and still not being able to reproduce it. It's kind of an edge case then, but worth it to see if we can develop further on a different issue |
@metcoder95 so do you think i can open new issue? i was looking at the client-h2.js and the documentiation of node http2 and i have a question:
if the http2 documentations for goaway event says that "Transmits a GOAWAY frame to the connected peer without shutting down the Http2Session." ? |
Yeah, because it's kind of weird what triggers that condition, although I would consider it an edge case. The |
FWIW my repro no longer blows up on 6.10.2: https://replit.com/@StevenLuscher/DarkredIroncladMethods |
Let's continue the other topic with #3011 |
Bug Description
Under load, when used with an
Agent
dispatcher havingallowH2
set totrue
, fetch will sporadically throw anERR_ASSERTION
.Reproducible By
Click ‘fork and run’ here: https://replit.com/@StevenLuscher/DarkredIroncladMethods
Expected Behavior
If the problem is that the underlying request is failing, I would expect it to trigger the
catch
block. Otherwise, we may be looking at a bug with the http/2 implementation itself.Logs & Screenshots
Environment
The text was updated successfully, but these errors were encountered: