Skip to content

Implement request timeout handling, improve error logging and bump version to 3.3.9 - #185

Open
tushar-singh-spraxa wants to merge 3 commits into
mainfrom
bug/tushar/error_logging_issue
Open

Implement request timeout handling, improve error logging and bump version to 3.3.9#185
tushar-singh-spraxa wants to merge 3 commits into
mainfrom
bug/tushar/error_logging_issue

Conversation

@tushar-singh-spraxa

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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): a setTimeout/settled/finish guard destroys the H2 stream on timeout, and AbortSignal.timeout is passed to fetch.
  • Wrapped buildBatchRequest/buildRequest + sendRequest in try/catch so failures are logged (not rethrown), preventing the transport stream from being destroyed; added success/failure console messages.
  • Bumped package version from 3.3.8 to 3.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.

Comment thread lib/pino-http-send.mjs Outdated
Comment thread lib/pino-http-send.mjs
@durlabhjain

Copy link
Copy Markdown
Owner

@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>

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@copilot Fix all PR review comments - remove console.log for success scenario and update JSDoc

Updated: removed the success-only console.log calls from lib/pino-http-send.mjs and added the timeoutMs option to the JSDoc. The focused flush regression check still passes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@durlabhjain

Copy link
Copy Markdown
Owner

@copilot Review this thoroughly and identify/ create a new PR if we can handle the failures any other/ better way

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants