-
Notifications
You must be signed in to change notification settings - Fork 22
Fix journal health check registration without event adapters #667
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
Fix journal health check registration without event adapters #667
Conversation
Fixes akkadotnet#666 Journal health checks were not being registered when using .WithHealthCheck() without adding event adapters. This was caused by an early return in AkkaPersistenceJournalBuilder.Build() that exited before health check registration occurred. Changes: - Move health check registration before the early return to ensure health checks are registered regardless of event adapter configuration - Add regression test that verifies health checks work without adapters All 16 persistence hosting tests pass.
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.
Detailed my changes
| Builder.WithHealthCheck(HealthCheckRegistration); | ||
|
|
||
| // useless configuration - don't bother. | ||
| if (Adapters.Count == 0 || Bindings.Count == 0) |
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.
This was the source of the bug.
| /// Regression test for https://github.com/akkadotnet/Akka.Hosting/issues/666 | ||
| /// Ensures journal health checks are registered even without event adapters | ||
| /// </summary> | ||
| public sealed class JournalHealthCheckWithoutAdaptersSpec : Akka.Hosting.TestKit.TestKit |
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.
Regression test for #666
Fixes #666
Summary
Journal health checks were not being registered when using
.WithHealthCheck()without adding event adapters. This was caused by an early return inAkkaPersistenceJournalBuilder.Build()that exited before health check registration occurred.Changes
AkkaPersistenceHostingExtensions.cs:113-133to ensure health checks are registered regardless of event adapter configurationJournalHealthCheckWithoutAdaptersSpecthat verifies health checks work without event adaptersTesting
All 16 persistence hosting tests pass, including the new regression test that specifically tests the bug scenario.