GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(badger): Reject non-positive TTL and intervals by auraCodesKM · Pull Request #9811 · jaegertracing/jaeger

Conversation

@auraCodesKM

@auraCodesKM auraCodesKM commented Oct 8, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Which problem is this PR solving?

  • Resolves [Bug]: Zero or negative Badger ttl.spans and interval settings pass validation, then panic at startup or make new spans unqueryable #9810

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

  • badger.Config.Validate() now rejects values <= 0 for these three settings, with an error that names the YAML key, for example:
    extensions::jaeger_storage::config::backends::s::badger: ttl.spans must be a positive duration
  • The check runs at config validation, the same boundary fix(remotesampling): Reject non-positive leader election lease refresh intervals #9647 and fix(clickhouse): Reject default_search_depth exceeding max_search_depth and negative dial_timeout #9725 use for similar checks, so the factory and writer code are unchanged.
  • The non-required fields not set test case used an all-zero Config{}, which is now invalid. It now sets only the three durations, so it still checks that the other fields are optional, and a separate case checks that DefaultConfig() validates.

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

  • I have read https://github.com/jaegertracing/jaeger/blob/main/CONTRIBUTING_GUIDELINES.md
  • I have signed all commits
  • I have added unit tests for the new functionality
  • I have run lint and test steps successfully: make lint test

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.

All reactions
@auraCodesKM
auraCodesKM requested a review from a team as a code owner October 8, 2026 21:44
Copilot AI balanced review requested due to automatic review settings October 8, 2026 21:44
Copilot AI reviewed Oct 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

All reactions
@auraCodesKM

auraCodesKM commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

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!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jkowall jkowall added the changelog:bugfix-or-minor-feature label Oct 19, 2026
@auraCodesKM
fix(badger): Reject non-positive TTL and intervals
3ff4c11
Signed-off-by: Kavin Thakur <[email protected]>
@auraCodesKM
auraCodesKM force-pushed the fix/badger-nonpositive-durations branch from 995cc24 to 3ff4c11 Compare October 20, 2026 07:06
Copilot AI balanced review requested due to automatic review settings October 20, 2026 07:06
Copilot AI reviewed Oct 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

All reactions
@yurishkuro yurishkuro added the storage/badger Issues related to badger storage label Oct 21, 2026
@auraCodesKM

auraCodesKM commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

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!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jkowall
jkowall requested a balanced review from Copilot November 28, 2026 19:54
Copilot started reviewing on behalf of jkowall November 28, 2026 19:54
View session
Copilot AI reviewed Nov 28, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

All reactions
@jkowall
Merge branch 'main' into fix/badger-nonpositive-durations
589dd43
Copilot AI balanced review requested due to automatic review settings November 28, 2026 20:51
Copilot AI reviewed Nov 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

All reactions
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Explain Change →

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

  • [Bug]: Badger Config.Validate() does not reject non-positive MaintenanceInterval or MetricsUpdateInterval, causing panic on startup #10087 — This PR adds the non-positive interval checks described in the issue.

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: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 Passed [#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 Passed 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)

  • Create a new PR
  • 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Nov 28, 2026

Copy link
Copy Markdown

This pull request is labelled unapproved-issue because it is not linked to an open issue that carries the help wanted label:

  • [Bug]: Zero or negative Badger ttl.spans and interval settings pass validation, then panic at startup or make new spans unqueryable #9810 is not labelled help wanted

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the unapproved-issue label Nov 28, 2026
@codecov

codecov Bot commented Nov 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ 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           
Flag Coverage Δ
badger_direct 5.93% <0.00%> (-0.01%) ⬇️
badger_e2e 10.28% <50.00%> (+0.01%) ⬆️
cassandra-4.x-direct-manual 10.11% <0.00%> (-0.01%) ⬇️
cassandra-4.x-e2e-auto 15.49% <0.00%> (-0.01%) ⬇️
cassandra-4.x-e2e-manual 15.49% <0.00%> (-0.01%) ⬇️
cassandra-5.x-direct-manual 10.11% <0.00%> (-0.01%) ⬇️
cassandra-5.x-e2e-auto 15.49% <0.00%> (-0.01%) ⬇️
cassandra-5.x-e2e-manual 15.49% <0.00%> (-0.01%) ⬇️
clickhouse-direct-lts-august 14.59% <0.00%> (-0.01%) ⬇️
clickhouse-direct-lts-march 14.59% <0.00%> (-0.01%) ⬇️
clickhouse-e2e-lts-august 17.62% <0.00%> (-0.01%) ⬇️
clickhouse-e2e-lts-march 17.62% <0.00%> (-0.01%) ⬇️
elasticsearch-7.x-direct 25.11% <0.00%> (-0.02%) ⬇️
elasticsearch-8.x-direct 25.15% <0.00%> (-0.02%) ⬇️
elasticsearch-8.x-e2e 22.22% <0.00%> (-0.01%) ⬇️
elasticsearch-9.x-direct 25.15% <0.00%> (-0.02%) ⬇️
elasticsearch-9.x-e2e 22.22% <0.00%> (-0.01%) ⬇️
grpc_direct 15.63% <0.00%> (-0.01%) ⬇️
grpc_e2e 17.99% <0.00%> (-0.01%) ⬇️
kafka-3.x-v2 25.89% <0.00%> (+<0.01%) ⬆️
memory_v2 18.65% <0.00%> (-0.01%) ⬇️
opensearch-1.x-direct 25.11% <0.00%> (-0.02%) ⬇️
opensearch-2.x-direct 25.11% <0.00%> (-0.02%) ⬇️
opensearch-2.x-e2e 22.22% <0.00%> (-0.01%) ⬇️
opensearch-3.x-direct 25.11% <0.00%> (-0.02%) ⬇️
opensearch-3.x-e2e 22.22% <0.00%> (-0.01%) ⬇️
query 15.83% <0.00%> (-0.01%) ⬇️
tailsampling-processor 5.85% <0.00%> (-0.01%) ⬇️
unittests 97.69% <100.00%> (+<0.01%) ⬆️

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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Nov 28, 2026

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jkowall
jkowall approved these changes Nov 28, 2026
View reviewed changes

@jkowall jkowall left a comment

Copy link
Copy Markdown
Contributor

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.

All reactions
@jkowall
jkowall merged commit b3f4976 into jaegertracing:main Nov 28, 2026
84 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@jkowall jkowall mentioned this pull request Nov 28, 2026
fix(badger): Reject non-positive maintenance and metrics intervals (#10087) #10088
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@jkowall jkowall jkowall approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

changelog:bugfix-or-minor-feature storage/badger Issues related to badger storage unapproved-issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: Zero or negative Badger ttl.spans and interval settings pass validation, then panic at startup or make new spans unqueryable

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@auraCodesKM @jkowall @yurishkuro
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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.