-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
Closed as not planned
Closed as not planned
Copy link
Labels
httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.
Description
- Version: 10.x.x, 12.x.x, 14.x.x, 15.x.x
- Platform:
Linux solus 5.6.19-159.current #1 SMP PREEMPT Fri Oct 16 17:49:06 UTC 2020 x86_64 GNU/Linux - Subsystem: http
What steps will reproduce the bug?
const http = require('http');
const request = http.get('http://httpbin.org/anything', response => {
setTimeout(() => {
console.log(`request.destroyed = ${request.destroyed}`);
console.log(`response.destroyed = ${response.destroyed}`);
response.destroy(new Error('failure'));
}, 1000);
});How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
An error with a message failure.
What do you see instead?
No error.
Additional information
While I understand that request is destroyed on socket close, the response.destroy logic is broken:
Lines 121 to 125 in c1da528
| IncomingMessage.prototype.destroy = function destroy(error) { | |
| if (this.socket) | |
| this.socket.destroy(error); | |
| return this; | |
| }; |
The error is not thrown because the socket has been destroyed. Although the response has not.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.