Await provider readiness and drain application lifecycles - #1
Draft
elucidsoft wants to merge 4 commits into
Draft
elucidsoft wants to merge 4 commits into
elucidsoft wants to merge 4 commits into
Conversation
Make provider startup await ready Redis connections, disable offline buffering, and expose bounded subscription acknowledgement for consumers that must reconcile after subscribing. Reject waiters on failure or shutdown. Validation: full TypeScript check and 3157 tests passed, including 95 websocket-redis tests and real cross-instance subscription delivery.
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.
Application shutdown previously returned early to concurrent callers, hid provider failures and deadlines, and could leave partially started resources running after failed startup. Shutdown now waits for HTTP before stopping event, workflow and WebSocket providers, shares its outcome, rejects failure, and removes owned process listeners. Successful restart remains supported.
Bootstrap prepares event consumers but activates their subscriptions only after startup hooks and workflow-provider readiness. The BullMQ workflow provider waits for its producer and every step/parent worker; failed event-worker registration closes the candidate. WebSocket clients retire old sockets before manual reconnect so delayed callbacks cannot clear a replacement connection or lose its room rejoin.
Requires Bun 1.4.2 for the verified server-drain behaviour. Existing local CORS and consumer-injection fixes are preserved in a separate prerequisite commit. Shutdown hooks remain best-effort; a timeout does not cancel unfinished work, and consumer dependencies must stay open until provider drain succeeds.
Validation: the final full framework run passes 3,157 tests; TypeScript passes; lint exits successfully with warnings. The linked ActLume consumer passes 103 backend tests and both browser tests, including coordinator startup and SIGTERM. Earlier full runs had intermittent Redis connection-closed and cache stale-timeout failures; the cache case passed in isolation and the final full suite passed. Those intermittent failures remain unresolved. Automated review tooling was unavailable in these standalone checkouts.