Skip to content

Fix: race in NextBackoff#92

Merged
dim merged 1 commit into
bsm:mainfrom
iSerganov:retry_fix
May 20, 2026
Merged

Fix: race in NextBackoff#92
dim merged 1 commit into
bsm:mainfrom
iSerganov:retry_fix

Conversation

@iSerganov
Copy link
Copy Markdown
Contributor

Load & Add are two atomic ops called one by one, so concurrent callers can both pass the check before either increments. E.g., LimitRetry(.., 3) can occasionally allow 4+ attempts under high load. Switching to a single atomic Add fixes the race.

'Load' & 'Add' are two atomic ops, so concurrent callers can both pass the check before either increments.
E.g.,  LimitRetry(.., 3) can occasionally allow 4+ attempts under high load. Switching to a single atomic Add fixes the race.
@iSerganov
Copy link
Copy Markdown
Contributor Author

@dim, can you please have a look when you have a minute?

@dim dim merged commit 76760bd into bsm:main May 20, 2026
2 checks passed
@dim
Copy link
Copy Markdown
Member

dim commented May 20, 2026

Thanks!!

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