Repository navigation
Conversation
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.
Summary
Add an optional
http_healthmodule providing HTTP liveness and readiness endpoints throughhttpd.Details
Kubernetes probes and DNS services with HTTP health checks need an HTTP status code to determine whether an OpenSIPS instance is ready to receive traffic.
This builds on the drain module introduced in #4301 by exposing its readiness signal through HTTP status codes, while keeping liveness successful during draining.
Solution
/healthzreturns 200 while the HTTP handler can respond./readyzreturns 200 when the core is running and an optional configured Status/Report group has a positive status; otherwise 503.readiness_grouptodrainmakes readiness reflect the existing drain state. Without this parameter, readiness checks only the core status.Liveness does not check SIP worker responsiveness. These endpoints do not themselves remove instances from DNS or terminate them; external health-check configuration is still required. Existing
httpdauthentication applies to both endpoints.Validated with a
-Wall -Werrorbuild and live integration tests covering drain/recovery, initial drain state, missing groups, core-only readiness, and liveness during draining.Compatibility
The module is optional and requires
httpd. Existing configurations remain unchanged unless the module is loaded.SIP routing, SIP OPTIONS responses and the existing drain behavior are unchanged.
Closing issues
None.