Skip to content

Conversation

@evantahler
Copy link
Member

Summary

  • Add .catch() handlers to all fire-and-forget async calls in Worker and Scheduler that previously discarded Promise return values from timer callbacks (setInterval/setTimeout). Caught errors are routed through the existing "error" event emitter.
  • Add tests verifying that Redis failures during ping() and poll() timer callbacks emit "error" events instead of becoming unhandled promise rejections.

Fixes #1260

Test plan

  • Existing test suite passes (115 tests, 14 suites)
  • New worker test: stubs redis.set to throw during ping interval, asserts error is emitted
  • New scheduler test: stubs redis.set to throw during poll timer, asserts error is emitted

🤖 Generated with Claude Code

evantahler and others added 3 commits February 8, 2026 19:27
…during shutdown

Add .catch() handlers to all fire-and-forget async calls in Worker
and Scheduler that were previously discarding Promise return values
from timer callbacks. This prevents unhandled rejections when a shared
Redis connection is closed during shutdown. Fixes #1260.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verify that Worker and Scheduler emit errors via the "error" event
instead of causing unhandled promise rejections when Redis commands
fail during ping/poll timer callbacks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@evantahler evantahler merged commit 5cd81ef into main Feb 9, 2026
12 checks passed
@evantahler evantahler deleted the fix/unhandled-promise-rejections-during-shutdown branch February 9, 2026 03:44
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.

Fire-and-forget async calls cause unhandled promise rejections during shutdown

1 participant