Skip to content

fix(node-sdk): prevent SDK from forcing application shutdown - #727

Merged
roncohen merged 2 commits into
mainfrom
buc-4278-prevent-reflag-sdk-from-forcing-shutdown
Sep 11, 2026
Merged

fix(node-sdk): prevent SDK from forcing application shutdown#727
roncohen merged 2 commits into
mainfrom
buc-4278-prevent-reflag-sdk-from-forcing-shutdown

Conversation

@roncohen

Copy link
Copy Markdown
Contributor

Summary

  • Remove SDK signal handlers and forced process termination so applications retain ownership of graceful shutdown, regardless of handler registration order.
  • Keep best-effort automatic flushing on natural event-loop shutdown (beforeExit).
  • Only report interrupted automatic flushes, avoiding false warnings when applications flush explicitly before exiting.
  • Update API documentation, README, and changeset.

Trade-off / migration

Installing a Node signal listener suppresses default termination, so removing only process.exit() can leave applications running indefinitely. This change removes signal interception altogether.

Automatic flushing on termination signals is no longer provided. Applications should await client.flush() in their existing graceful shutdown hooks after draining in-flight work and before exiting. batchOptions.flushOnExit now applies only to natural event-loop shutdown.

Validation

  • Node SDK: all 230 tests pass.
  • Node SDK TypeScript build passes; lint and formatting checks pass.
  • Real-process regression tests cover unhandled SIGTERM/SIGINT, asynchronous shutdown handlers registered before and after SDK initialization, multiple clients, exit-code preservation, and explicit flushing before exit.

Fixes BUC-4278.

Copilot AI lite review requested due to automatic review settings September 11, 2026 12:34

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 11, 2026 12:37
@roncohen
roncohen enabled auto-merge September 11, 2026 12:37

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@roncohen
roncohen added this pull request to the merge queue Sep 11, 2026
Merged via the queue into main with commit c69ee92 Sep 11, 2026
7 of 8 checks passed
@roncohen
roncohen deleted the buc-4278-prevent-reflag-sdk-from-forcing-shutdown branch September 11, 2026 12:48
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