You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
node:http: instantiating globalThis.Headers in an in-process http.Server + client program hangs the response pump #5174
Split out of #4965 (the setHeaders SIGSEGV, fixed separately). Once that crash is fixed, test-http-response-setheaders.js no longer segfaults but hangs — and the hang is not caused by setHeaders.
Minimal repro (no setHeaders involved)
consthttp=require('http');constserver=http.createServer((req,res)=>{constheaders=newglobalThis.Headers({foo: '1'});// created, never usedres.writeHead(200,{foo: '1',bar: '2'});res.end();});server.listen(0,()=>{constreq=http.get({port: server.address().port},(res)=>{console.log('STATUS',res.statusCode);// never printsres.on('end',()=>server.close());res.resume();});req.on('error',(e)=>console.error('client err',e.message));});
With the new globalThis.Headers(...) line → process hangs (exit 124 under timeout); the in-process http client's response callback never fires and res.end() on the server completes but the body/headers never reach the client.
Remove that one line → STATUS 200 prints, process exits 0.
new globalThis.Headers(...) on its own (no server/client) is fine and exits cleanly — it's specifically the Headers + in-process http.Server + http client combination that wedges the response pump. Likely the fetch/http-client subsystem init triggered by Headers interferes with the http-server pump's event-loop draining.
Impact
Blocks test-http-response-setheaders.js from completing end-to-end even though the #4965 SIGSEGV is fixed and setHeaders now applies Headers/Map entries and throws the correct ERR_* codes.
Found on feat/size-optimize-npm worktree off v0.5.1171.
Activity
fix(http): res.setHeaders no longer SIGSEGVs on Headers; correct Head…
fix(http): res.setHeaders no longer SIGSEGVs on Headers; correct Head…
fix(http): split web-fetch from bundled node:http client so Headers +…
fix(fetch): register instanceof kind-probe under web-fetch, not http-…