fix(processing): add per-step timeout enforcement to gracefulshutdown - #492
Open
beulah7717108-eng wants to merge 2 commits into
Open
fix(processing): add per-step timeout enforcement to gracefulshutdown#492beulah7717108-eng wants to merge 2 commits into
beulah7717108-eng wants to merge 2 commits into
Conversation
… - graceful shutdown timeout, soft-delete users, observability
Each shutdown hook accepts an optional timeoutMs override. Timed-out steps log a warning and shutdown continues to the next step. drainAll() in SessionRegistry respects a per-session drain timeout. Added SHUTDOWN_TIMEOUT_MS and SESSION_DRAIN_TIMEOUT_MS to config.ts. Closes XStreamRollz#342
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds per-step timeout enforcement to
GracefulShutdownso no single hanging hook can block the entire shutdown sequence. Each registered shutdown hook now accepts an optionaltimeoutMsoverride. If a step exceeds its timeout, a warning is logged and shutdown continues to the next step.drainAll()inSessionRegistryalso respects a per-session drain timeout via theSESSION_DRAIN_TIMEOUT_MSenv var.Also adds
SHUTDOWN_TIMEOUT_MSandSESSION_DRAIN_TIMEOUT_MSto the config Zod schema so these values are validated at startup rather than read raw fromprocess.env.Related issues
Closes #342
Type of change
Testing performed
Tests added:
drainAll()with timeout when a session'sstop()hangs foreverChecklist — author
origin/mainand resolved conflicts.npm run lint,npm run build,npm test.