Repository navigation
http: OutgoingMessage ERR_STREAM_DESTROYED callback #36673
Copy link
Copy link
Closed as not planned
Labels
httpIssues and PRs related to the http subsystem.Issues and PRs related to the http subsystem.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.streamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
Description
Activity
- addedhttpIssues and PRs related to the http subsystem.Issues and PRs related to the http subsystem.streamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
on Dec 29, 2020 Tested with node 26.1.0
Minimal repro
import http from 'node:http'; const msg = new http.OutgoingMessage(); msg.destroy(); const result = await Promise.race([ new Promise((resolve) => { msg._writeRaw('data', (err) => resolve(err?.code ?? 'no error')); }), new Promise((resolve) => setTimeout(() => resolve('callback not called'), 100)), ]); console.log(result);
Observed
callback not calledThis is because
_writeRaw()returns after destruction without invoking the callbackExpected
ERR_STREAM_DESTROYEDThis should match stream write callback behavior for already-destroyed streams.
- added a commit that references this issue
on Aug 2, 2026 github-actions commented
on Aug 19, 2026 on Aug 19, 2026 – with GitHub ActionsContributorMore actionsThis issue has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Aug 19, 2026 github-actions commented
on Sep 19, 2026 on Sep 19, 2026 – with GitHub ActionsContributorMore actionsThis issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.
Metadata
Metadata
Assignees
Labels
httpIssues and PRs related to the http subsystem.Issues and PRs related to the http subsystem.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.streamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
OutgoingMessageshould invoke the callback for_writeRawwithERR_STREAM_DESTROYEDwhen the it's already been destroyed.Refs: #29227 (comment)