Skip to content

fix: clamp set interval guage to max interval#3954

Open
grutt wants to merge 1 commit into
mainfrom
fix--clamp-set-interval-guage
Open

fix: clamp set interval guage to max interval#3954
grutt wants to merge 1 commit into
mainfrom
fix--clamp-set-interval-guage

Conversation

@grutt
Copy link
Copy Markdown
Contributor

@grutt grutt commented May 18, 2026

Description

Prevents wraparoudn which could lead to signifcant scheduling delays

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Copilot AI review requested due to automatic review settings May 18, 2026 19:56
@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hatchet-docs Ready Ready Preview, Comment May 18, 2026 7:57pm

Request Review

@grutt grutt changed the title fix: clamp set interval guage to ma interval fix: clamp set interval guage to max interval May 18, 2026
@grutt grutt requested a review from mrkaye97 May 18, 2026 19:57
@grutt grutt requested review from abelanger5 and removed request for mrkaye97 May 18, 2026 19:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a potential time.Duration overflow in the interval backoff logic that could cause the interval to wrap around (becoming negative/small) and lead to unexpectedly long or erratic scheduling delays.

Changes:

  • Clamp currInterval to maxInterval before doubling would overflow/exceed the maximum.
  • Add a unit test to validate that the interval caps at maxInterval instead of overflowing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/operation/interval.go Prevents overflow by capping currInterval at maxInterval when doubling would exceed it.
internal/operation/interval_test.go Adds a regression test ensuring the cap happens before an overflow can occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants