GeezerVison is showing github.com — fix(badger): Reject non-positive TTL and intervals by auraCodesKM · Pull Request #9811 · jaegertracing/jaeger
Conversation
auraCodesKM
commented
Oct 8, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Which problem is this PR solving?
Zero or negative values for three Badger settings pass jaeger validate:
ttl.spans
maintenance_interval
metrics_update_interval
The two intervals then panic at startup in time.NewTicker. A non-positive TTL causes newly written spans to be immediately unqueryable, with nothing logged.
Description of the changes
This PR rejects <= 0 but does not claim zero must stay invalid. Today any value <= 0 either crashes Jaeger or makes new spans unqueryable, so no working config depends on it, and rejecting it leaves room to give zero a meaning later. If you would prefer ttl.spans: 0 to mean no expiry (as ttl: 0 does for ClickHouse and trace_ttl: 0 for Cassandra), or a zero interval to disable that job, I can change the implementation in this PR.
How was this change tested?
- New
TestValidate_ReturnsErrorForNonPositiveDurations covers zero and negative values for each setting. All six cases fail without the fix and pass with it.
jaeger validate with each invalid value exits 1 with an error naming the setting. cmd/jaeger/config-badger.yaml, cmd/jaeger/config.yaml, and small positive values such as 1s still validate.
make fmt, make lint (0 issues) and make test (all packages pass).
Checklist
AI Usage in this PR (choose one)
See AI Usage Policy.
- None: No AI tools were used in creating this PR
- Light: AI provided minor assistance (formatting, simple suggestions)
- Moderate: AI helped with code generation or debugging specific parts
- Heavy: AI generated most or all of the code changes
Summary by CodeRabbit
- Bug Fixes
- Storage configurations now fail validation when the span time-to-live, maintenance interval, or metrics update interval is zero or negative. Valid configurations continue through the existing validation checks, helping prevent invalid timing settings from being accepted.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Hi, just following up on this PR. The CI workflows still seem to be waiting for maintainer approval. Could someone approve them when they get a chance? make fmt, make lint, and make test all passed locally on this commit. Thanks for taking a look!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Hi, just following up on my earlier message. GitHub still shows the required CI workflows awaiting maintainer approval, and the code-owner review is pending.
@yurishkuro Could you take a look when convenient, or point me to the appropriate code owner? The local make fmt, make lint, and make test checks passed on this commit. I'm happy to address any feedback.
Thanks for your time!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
🟢 Approval recommended
No active review issues were identified for the change rejecting non-positive Badger TTL and interval settings.
No open issues 🎉
Review effort: Balanced
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 28, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
Badger configuration validation now rejects non-positive spans TTL, maintenance interval, and metrics update interval values. Tests cover zero and negative values, along with valid configurations.
Changes: Badger duration validation
| Layer / File(s) |
Summary |
Validate Badger durations internal/storage/v1/badger/config.go, internal/storage/v1/badger/config_test.go |
Config.Validate returns a specific error when any of the three duration settings is non-positive. Tests check zero and negative values and valid configurations. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
Suggested reviewers: mahadzaryab1, yurishkuro
Merge Risk: Minimal · up to 589dd
-
Badger configuration validation now rejects zero or negative span TTL, maintenance interval and metrics update interval values with clear errors, instead of panicking at startup or silently making new spans unqueryable. Valid and default configurations are unaffected. No material merge risk remains.
Security architecture risk: Minimal · up to 589dd
-
Badger now reports invalid duration settings earlier on paths that use its validator. Defaults are unchanged. The change does not expand access to the store or alter how it writes or expires spans.
Retained concerns
No architecture-level concerns identified.
Security review details
-
Trust Boundaries and Controls
- observed — The change adds a rejection check at the existing configuration boundary. It does not add a caller, change caller authority, or modify storage initialization.
Resilience and Maintainability Implications
- inferred — Where invoked before construction, validation contains invalid settings before they can cause a startup ticker panic or immediately expired spans. Factory paths that do not invoke the validator remain unchanged.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Description Check |
 |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
 |
The title "fix(badger): Reject non-positive TTL and intervals" states the main change: Config.Validate now rejects zero or negative ttl.spans, maintenance_interval, and metrics_update_interval. It nam… |
| Linked Issues check |
 |
[#9810] requires that zero or negative values for ttl.spans, maintenance_interval, and metrics_update_interval be rejected at validation, with an error naming the setting. The diff to internal/storage… |
| Out of Scope Changes check |
 |
The whole-PR changes are limited to internal/storage/v1/badger/config.go (validation checks and error variables, plus the errors import) and config_test.go (test updates). All of these directly implem… |
Full details: Title check
-
Explanation
The title "fix(badger): Reject non-positive TTL and intervals" states the main change: Config.Validate now rejects zero or negative ttl.spans, maintenance_interval, and metrics_update_interval. It names the affected component (badger) and the kind of change (fix). It is specific and matches the changeset and the linked issue scope.
Full details: Linked Issues check
-
Explanation
[#9810] requires that zero or negative values for ttl.spans, maintenance_interval, and metrics_update_interval be rejected at validation, with an error naming the setting. The diff to internal/storage/v1/badger/config.go adds checks in Config.Validate() for TTL.Spans, MaintenanceInterval, and MetricsUpdateInterval, each returning a named error ("ttl.spans must be a positive duration", "maintenance_interval must be a positive duration", "metrics_update_interval must be a positive duration"). Non-positive values now fail before govalidator runs. This covers the panic in time.NewTicker and the silent expiry of new spans. The PR also updates config_test.go with a table-driven test for zero and negative values and a DefaultConfig() validity check. The open question on zero semantics is answered by rejecting zero. The PR description states this choice and offers to change it. Rejecting zero is a valid reading of the issue's expected behavior, so no requirement remains unmet. Evidence is from the diff; I did not run the test suite.
Full details: Out of Scope Changes check
-
Explanation
The whole-PR changes are limited to internal/storage/v1/badger/config.go (validation checks and error variables, plus the errors import) and config_test.go (test updates). All of these directly implement or test the Badger validation requested in #9810. No factory, writer, or unrelated code changed. The raw summary lists no other files.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
11fa89a2-5623-43dc-b570-e3a90038e669
Commits
-
Reviewing files that changed from the base of the PR and between 6c5e81a and 589dd43.
Files selected for processing: 2
-
internal/storage/v1/badger/config.go
internal/storage/v1/badger/config_test.go
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
This pull request is labelled unapproved-issue because it is not linked to an open issue that carries the help wanted label:
Jaeger accepts a pull request only for an issue that a maintainer has marked help wanted, as described in Link each pull request to an issue. To resolve this, ask on the linked issue whether the maintainers would accept a contribution. A maintainer who accepts it adds the help wanted label to the issue.
The pull request is closed automatically 7 days after this comment was posted unless it is linked to such an issue by then. A maintainer can exempt the pull request with the no-issue-needed label.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
codecov
Bot
commented
Nov 28, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.70%. Comparing base (6c5e81a) to head (589dd43).
Additional details and impacted files
@@ Coverage Diff @@
## main #9811 +/- ##
=======================================
Coverage 98.70% 98.70%
=======================================
Files 433 433
Lines 22034 22040 +6
=======================================
+ Hits 21748 21754 +6
Misses 286 286
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.
🚀 New features to boost your workflow:
- ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
CI Summary Report
Metrics Comparison
⚠️ 4 metric change(s) detected (informational)
View changed metrics
For label-level diff details, open the CI run and expand the "Compare metrics and generate summary" step logs.
metrics_snapshot_kafka_v2 — ⬇️ download diff
4 modified
otelcol_kafka_exporter_bytes
otelcol_kafka_exporter_bytes_uncompressed
otelcol_kafka_exporter_messages
otelcol_kafka_exporter_records
Code Coverage
✅ Coverage 98.7% (baseline 98.7%)
➡️ View CI run | View publish logs
2026-11-28 21:20:16 UTC
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
LGTM, thanks. Validate() was a no-op before since Config has no govalidator tags, and both intervals go straight into time.NewTicker, so this turns a startup panic (or spans written already expired) into a clear config error on jaeger validate, collector load and remote-storage. Defaults are positive, so only explicit zero or negative values get rejected, and each of the six new cases fails without its guard. Small heads-up for the changelog: a read-only instance that set ttl.spans: 0s will now be rejected, which seems fine. This also covers #10088, which I'll close as a duplicate.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
jkowall
jkowall approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|