Skip to content

Conversation

@bdeitte
Copy link
Owner

@bdeitte bdeitte commented Jan 19, 2026

Fix for #247 and a doc note for #239

Copilot AI review requested due to automatic review settings January 19, 2026 20:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes issue #247 by adding graceful handling for writes to destroyed streams/sockets, and documents issue #239 regarding metrics sent during process shutdown.

Changes:

  • Added checks in TCP and stream transports to prevent writes to destroyed streams/sockets
  • Added comprehensive test coverage for the destroyed stream scenario
  • Documented Node.js limitations around sending metrics during process shutdown with alternative approaches

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
lib/transport.js Added destroyed stream/socket checks before write operations in TCP and stream transports to prevent ERR_STREAM_DESTROYED errors
test/transport.js Added test cases verifying graceful error handling when writing to destroyed streams and successful writes to active streams
README.md Added documentation section explaining Node.js limitations for sending metrics during process exit and provided working alternatives

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bdeitte bdeitte merged commit a217494 into main Jan 24, 2026
13 checks passed
@bdeitte bdeitte deleted the fix-239-247 branch January 24, 2026 20:14
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.

2 participants