Fix journal health check registration without event adapters#667
Merged
Aaronontheweb merged 1 commit intoakkadotnet:devfrom Oct 2, 2025
Merged
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
commented
Oct 2, 2025
Member
Author
Aaronontheweb
left a comment
There was a problem hiding this comment.
Detailed my changes
| Builder.WithHealthCheck(HealthCheckRegistration); | ||
|
|
||
| // useless configuration - don't bother. | ||
| if (Adapters.Count == 0 || Bindings.Count == 0) |
Member
Author
There was a problem hiding this comment.
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 |
3 tasks
This was referenced Oct 2, 2025
This was referenced Oct 10, 2025
This was referenced Oct 28, 2025
This was referenced Nov 6, 2025
This was referenced Dec 17, 2025
This was referenced Jan 7, 2026
This was referenced Jan 27, 2026
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.
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.