Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed BulkheadImpl.releasePermit to ensure that it claims a permit when running a task from the pending queue #366

Merged
merged 2 commits into from Jun 24, 2023

Conversation

nicky9door
Copy link
Contributor

Before this change, releasePermit would check the queue but not modify the permit field. This could eventually result in permits being equal to maxPermits and would erroneously report the bulkhead as being full

This should fix issue #365

…when running a task from the pending queue

Before this change, releasePermit would check the queue but not modify the permit field. This could eventually
result in permits being equal to maxPermits and would erroneously report the bulkhead as being full

This should fix issue failsafe-lib#365
CheckedRunnable sleep = () -> {
ignoreExceptions(() ->{
System.out.println("Running sleep task " + (index + 1));
TimeUnit.SECONDS.sleep(1);
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for this! One suggestion: can you tweak the test case so it runs faster? Maybe a 10ms sleep, where the entire test case runs in < 250ms if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@jhalterman jhalterman merged commit ae8bac6 into failsafe-lib:master Jun 24, 2023
6 checks passed
@jhalterman
Copy link
Member

Thanks @nicky9door !

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.

None yet

2 participants