-
Notifications
You must be signed in to change notification settings - Fork 18
Add Redis connectivity health checks #447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Redis connectivity health checks #447
Conversation
Implement IAkkaHealthCheck-based connectivity checks for Redis journal and snapshot stores. These are liveness checks that proactively verify backend database connectivity using PING commands. Changes: - RedisJournalConnectivityCheck: Verifies journal connectivity - RedisSnapshotStoreConnectivityCheck: Verifies snapshot store connectivity - RedisConnectivityCheckSpec: Unit tests with 6 test cases covering healthy/unhealthy scenarios and parameter validation - All 6 tests passing Implements Akka.Hosting Epic #678.
- Upgraded Akka.Hosting from 1.5.53 to 1.5.55-beta1 - Upgraded Akka.NET from 1.5.53 to 1.5.55 - Added RedisConnectivityCheckExtensions with WithConnectivityCheck methods - Uses the new WithCustomHealthCheck() API from Akka.Hosting 1.5.55-beta1 - All 6 connectivity health check tests pass successfully
- Modified RedisConnectivityCheckSpec to use RedisFixture with Docker containers
- Added happy path tests that verify health checks return Healthy when Redis is available:
- Journal_Connectivity_Check_Should_Return_Healthy_When_Connected
- Snapshot_Connectivity_Check_Should_Return_Healthy_When_Connected
- Kept existing unhealthy path tests to verify failure detection
- Added [Collection("RedisSpec")] attribute to share Redis Docker containers across tests
- Tests now properly validate both success and failure scenarios
All 8 tests pass locally, ensuring the liveness checks work correctly on the happy path.
Aaronontheweb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to make some changes
| { | ||
| try | ||
| { | ||
| var connection = await ConnectionMultiplexer.ConnectAsync(_connectionString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to dispose this?
| { | ||
| try | ||
| { | ||
| var connection = await ConnectionMultiplexer.ConnectAsync(_connectionString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same - do we need to dispose this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tags need to be customizable for all health checks
- Fixed ConnectionMultiplexer disposal using 'using' statements in both Journal and Snapshot connectivity checks - Added customizable tags parameter to WithConnectivityCheck extension methods - Tags default to standard values but can now be customized by users Addresses all three review comments: 1. Proper disposal of Redis connections 2. Customizable tags for health checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was the README file packaging removed from this file?
Summary
Implements connectivity health checks for Redis persistence plugin to enable proactive monitoring of database connectivity status.
RedisJournalConnectivityCheckandRedisSnapshotStoreConnectivityCheckclasses implementingIAkkaHealthCheckTest Plan
References
Implements Akka.Hosting Epic: akkadotnet/Akka.Hosting#678