Skip to content

feat(sentinel): emit lifecycle events#3276

Open
raashish1601 wants to merge 1 commit into
redis:masterfrom
raashish1601:codex/3012-sentinel-lifecycle-events
Open

feat(sentinel): emit lifecycle events#3276
raashish1601 wants to merge 1 commit into
redis:masterfrom
raashish1601:codex/3012-sentinel-lifecycle-events

Conversation

@raashish1601
Copy link
Copy Markdown
Contributor

@raashish1601 raashish1601 commented May 15, 2026

Summary

Fixes #3012.

createSentinel() exposes isOpen and isReady, but it did not emit the lifecycle events that standalone clients expose. This adds connect and ready emissions after Sentinel finishes connecting, and emits end after closing or destroying an instance that was open.

The change is additive and keeps the event ordering aligned with the state a Sentinel consumer can observe.

Validation

  • .\node_modules\.bin\tsc.cmd --build packages/client --force --verbose
  • npm run lint:changed
  • git diff --check

Note: the focused Sentinel mocha test could not run locally because Docker is not installed in this Windows environment (spawn docker ENOENT).


Note

Low Risk
Low risk additive behavior change: emits connect/ready after successful RedisSentinel.connect() and emits end on close()/destroy() when previously open; could affect consumers that assume no events or different ordering.

Overview
RedisSentinel now emits lifecycle events consistent with standalone clients: connect and ready are emitted after connect() completes, and end is emitted after close() or destroy() when the instance was previously open.

Adds a focused sentinel test (lifecycle-events.spec.ts) asserting the connectreadyend event sequence and that end is observable via once() after shutdown.

Reviewed by Cursor Bugbot for commit ffdc7b5. Bugbot is set up for automated code reviews on this repo. Configure here.

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.

Sentinel Client: Add connect/ready/end events

1 participant