Implement request timeout handling, improve error logging and bump version to 3.3.9 - #185
Implement request timeout handling, improve error logging and bump version to 3.3.9#185tushar-singh-spraxa wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
It changes production logging/error-handling and network timeout semantics of a transport, and an unresolved operational concern (per-delivery success logging on a log-shipping transport) warrants human judgment.
Pull request overview
This PR hardens the lib/pino-http-send.mjs pino transport by adding a per-request timeout for both the HTTP/2 and fetch delivery paths, and by wrapping each delivery attempt in try/catch so a single failed (or malformed) log delivery can no longer trigger an unhandled rejection that permanently kills the transport stream. It also adds success/failure console diagnostics and bumps the package version.
Changes:
- Added a configurable request timeout (
timeoutMs, default 10s): asetTimeout/settled/finishguard destroys the H2 stream on timeout, andAbortSignal.timeoutis passed tofetch. - Wrapped
buildBatchRequest/buildRequest+sendRequestin try/catch so failures are logged (not rethrown), preventing the transport stream from being destroyed; added success/failureconsolemessages. - Bumped package version from
3.3.8to3.3.9.
File summaries
| File | Description |
|---|---|
lib/pino-http-send.mjs |
Adds request timeout handling (H2 + fetch), catches delivery errors to keep the stream alive, and logs delivery outcomes. |
package.json |
Version bump to 3.3.9. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@copilot Fix all PR review comments - remove console.log for success scenario and update JSDoc |
Co-authored-by: durlabhjain <18685657+durlabhjain@users.noreply.github.com>
Updated: removed the success-only |
There was a problem hiding this comment.
🔵 Needs a closer look
The changes alter async timeout and error-swallowing semantics in production logging infrastructure (delivery failures are now silently dropped) with no automated test covering the new timeout path, warranting human review.
Review details
- Files reviewed: 2/3 changed files
- Comments generated: 0 new
- Review effort level: Balanced
|
@copilot Review this thoroughly and identify/ create a new PR if we can handle the failures any other/ better way |
|
@durlabhjain I've opened a new pull request, #186, to work on those changes. Once the pull request is ready, I'll request review from you. |
No description provided.