| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Review requested:
|
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for sending this PR. Instead of introducing a new env variable and a console.log, please use the debuglog and NODE_DEBUG facilities.
Sorry, something went wrong.
| const serverTimeout = this.server.emit('timeout', this); | ||
|
|
||
| // Use util.debuglog for conditional logging | ||
| const debug = util.debuglog('http'); |
There was a problem hiding this comment.
move this to the top of the file
Sorry, something went wrong.
| @@ -0,0 +1,14 @@ | |||
| const assert = require('assert'); | |||
There was a problem hiding this comment.
This file is redundant and not testing anything, you can remove it
Sorry, something went wrong.
Sorry, something went wrong.
|
This pull request has been marked as stale due to 210 days of inactivity. |
Sorry, something went wrong.
|
This pull request has been marked as stale due to 90 days of inactivity. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What does this PR do?
This PR adds optional debug logging to the socketOnTimeout function in lib/_http_server.js. The logging is enabled only when the environment variable NODE_DEBUG_TIMEOUTS is set (e.g., NODE_DEBUG_TIMEOUTS=1 node app.js). It outputs details like whether the timeout affected the request, response, or server, helping debug issues like unexpected connection drops.
Example log output:
Socket timeout: req=true, res=false, server=false
This change is non-breaking, has no performance impact in production (since it's gated by an env var), and aligns with Node.js's debuglog patterns.
Why is this useful?
Changes
Diff summary (full diff in commits):
Testing
References
I signed the CLA. Let me know if any adjustments are needed!