Add severity-aware exit codes to traffic_ctl#13032
Draft
brbzull0 wants to merge 1 commit intoapache:masterfrom
Draft
Add severity-aware exit codes to traffic_ctl#13032brbzull0 wants to merge 1 commit intoapache:masterfrom
brbzull0 wants to merge 1 commit intoapache:masterfrom
Conversation
Emit a severity field in JSONRPC error data entries and add an --error-level flag to traffic_ctl so operators can control which annotation severities cause a non-zero exit code.
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.
Draft pr to follow up #13022
Emit a severity field in JSONRPC error data entries and add an
--error-levelflag totraffic_ctlso operators can control which annotation severities cause a non-zero exit code.Summary
severityfield to every JSONRPC error data entry on the wire. Handlers that setexplicit severity (e.g.
ERRATA_WARN) have it propagated; annotations without explicitseverity default to
DIAG(0).--error-level(-e) flag totraffic_ctl. It sets the minimum severity thresholdthat causes exit code 2. Default is
error, preserving current behavior for handlersthat don't set severity.
always exit 2 regardless of
--error-level.Motivation
Previously
traffic_ctlexited 2 for any server error, even informational messages like"Server already draining." This made it impossible for scripts to distinguish warnings from
real failures. With
--error-level, operators can tune the threshold (e.g.--error-level=warnto treat warnings as errors, or
--error-level=fatalto only fail on fatal conditions).Wire format change
Each entry in the JSONRPC error
dataarray now includes aseverityinteger:{"code": 9999, "severity": 4, "message": "Server already draining."} ^ newUsage examples