feat(ledger): add liveness/readiness probes and graceful shutdown - #144
Merged
Conversation
added 3 commits
June 16, 2026 10:21
configure spring boot health probes with a liveness group (jvm state only) and a readiness group aggregating db and liquibase, so a database outage drains traffic instead of restarting pods. expose component status without details on the public probe endpoints, and move actuator to a dedicated management port in the prod profile. enable graceful shutdown with a 30s drain window and emit a structured info event when the shutdown phase begins. Closes #64 Closes #65
spring boot 3.4+ validates health group membership at startup and fails the context when a referenced contributor is absent. disable strict validation so the readiness group degrades gracefully across environments; the probe integration tests still assert db and liquibase are present and up at runtime.
…aceful test the liquibase health contributor is not registered in every context, so the readiness group references readinessState and db only; a failed migration aborts startup before the server binds, so connectivity is the sufficient readiness signal. the graceful-drain test now calls webServer.shutDownGracefully instead of closing the spring test context, which avoided a double-close against @DirtiesContext.
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.
What
Adds Kubernetes-grade health signals and graceful shutdown to the ledger service. Config-only, no domain/schema change.
/actuator/health/liveness) reports JVM state only. A database outage drains traffic, it never restarts the pod (avoids a shared-DB restart storm)./actuator/health/readiness) aggregatesreadinessState+db+liquibase, so traffic is not routed before connectivity and migrations are ready.show-components: always) but not internals (show-details: never), safe for the unauthenticated/actuator/health/**paths.server.shutdown=gracefulwith a 30s drain window; a structured INFO event is logged when the shutdown phase begins.SecurityConfigand actuator exposure are unchanged (/actuator/health/**was already public).Tests
Integration tests run on CI (no Docker locally). Unit tests, detekt, spotless, assemble green locally.
Closes #64
Closes #65