Skip to content

Saturate overflowing smooth rate limiter permit durations - #405

Open
PHJ2000 wants to merge 1 commit into
failsafe-lib:masterfrom
PHJ2000:fix-smooth-rate-limiter-overflow
Open

PHJ2000 wants to merge 1 commit into
failsafe-lib:masterfrom
PHJ2000:fix-smooth-rate-limiter-overflow

Conversation

@PHJ2000

@PHJ2000 PHJ2000 commented Oct 5, 2026

Copy link
Copy Markdown

Cap the permit-duration product at Long.MAX_VALUE before it can overflow. Tests check that an immediate request is rejected without consuming permits and that an unbounded reservation stays positive.

Fixes #404.

Validation: all 308 core tests passed on Java 11, including both new regressions. Core packaging also completed. Full mvn verify stops in the OkHttp module at FailsafeCallTest.testCancel (expected IOException, received SocketException); the same test fails on unchanged upstream ed3f92739669. Retrofit tests were not reached.

This branch has not been deployed

No deployments
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.

Smooth rate limiter accepts a huge permit batch without waiting

1 participant