Skip to content

[SREP-3734] Fix retryer exponential backoff using XOR instead of exponentiation#3210

Open
smarthall wants to merge 1 commit intoopenshift:mainfrom
smarthall:fix/retryer-exponential-backoff
Open

[SREP-3734] Fix retryer exponential backoff using XOR instead of exponentiation#3210
smarthall wants to merge 1 commit intoopenshift:mainfrom
smarthall:fix/retryer-exponential-backoff

Conversation

@smarthall
Copy link
Copy Markdown
Member

@smarthall smarthall commented Apr 15, 2026

Summary

  • In Go, ^ is the bitwise XOR operator, not exponentiation. The expression 2^attempts produced incorrect sleep durations (2s, 3s, 0s, 1s) instead of the intended exponential backoff (1s, 2s, 4s, 8s).
  • Replaced 2^attempts with 1<<attempts (bit shift) to produce correct powers of 2.

Test plan

  • Verify the retryer sleep durations follow exponential backoff: 1s, 2s, 4s, 8s, etc.
  • Confirm OCM retry behavior works correctly in integration tests

🤖 Generated with Claude Code

In Go, ^ is the XOR operator, not exponentiation. The expression 2^attempts
produced incorrect sleep durations (2s, 3s, 0s, 1s) instead of the intended
exponential backoff (1s, 2s, 4s, 8s). Use bit shift (1<<attempts) instead.

Signed-off-by: Daniel Hall <danhall@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

There are test jobs defined for this repository which are not configured to run automatically. Comment /test ? to see a list of all defined jobs. Review these jobs and use /test <job> to manually trigger jobs most likely to be impacted by the proposed changes.Comment /pipeline required to trigger all required & necessary jobs.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: d146ac0e-d645-443c-8b59-d04672162bde

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from YiqinZhang and minlei98 April 15, 2026 05:17
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 15, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: smarthall
Once this PR has been reviewed and has the lgtm label, please assign yiqinzhang for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ritmun
Copy link
Copy Markdown
Contributor

ritmun commented Apr 15, 2026

/pipeline required

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test hypershift-pr-check

@ritmun
Copy link
Copy Markdown
Contributor

ritmun commented Apr 15, 2026

/retest

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 15, 2026

@smarthall: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@smarthall smarthall changed the title Fix retryer exponential backoff using XOR instead of exponentiation [SREP-3734] Fix retryer exponential backoff using XOR instead of exponentiation Apr 21, 2026
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