Skip to content

Fix nomad certificate backoff overflow - #1023

Merged
ChrisSchinnerl merged 2 commits into
masterfrom
pj/nomad-backoff-overflow
Sep 30, 2026
Merged

ChrisSchinnerl merged 2 commits into
masterfrom
pj/nomad-backoff-overflow

Conversation

@peterjan

Copy link
Copy Markdown
Member

This PR fixes an overflow in the backoff algo in the certificate provider. It's hard to reach though, but I found that we fixed a similar issue in 2151fb7 in the connectivity manager so figured we probably want to harden this here as well. Found out through SiaFoundation/indexd#1119 which fixes a similar overflow.

@peterjan
peterjan requested a balanced review from Copilot September 28, 2026 14:36
@peterjan peterjan self-assigned this Sep 28, 2026
@github-project-automation github-project-automation Bot moved this to In Progress in Sia Sep 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The bounded calculation preserves expected behavior and is adequately covered by regression tests.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes certificate retry backoff overflow by safely clamping exponential growth.

Changes:

  • Replaces floating-point backoff calculation with bounded bit shifting.
  • Adds regression and boundary tests.
  • Documents the patch in a changeset.
File Description
certificates/​providers/​nomad/​nomad.go Prevents backoff duration overflow.
certificates/​providers/​nomad/​nomad_test.go Tests backoff limits and edge cases.
.changeset/​fix_certificate_backoff_overflow.md Records the bug fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@peterjan
peterjan marked this pull request as ready for review September 28, 2026 15:14

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

Comment thread certificates/providers/nomad/nomad_test.go Outdated
chris124567
chris124567 previously approved these changes Sep 29, 2026
@ChrisSchinnerl
ChrisSchinnerl merged commit b8313e4 into master Sep 30, 2026
13 checks passed
@ChrisSchinnerl
ChrisSchinnerl deleted the pj/nomad-backoff-overflow branch September 30, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants