failsafe
failsafe copied to clipboard
Fix bulkhead race condition
There were a couple of race conditions in Bulkhead implementation that resulted in permits leaking and eventually all processing protected by bulkhead stopping.
This PR is split by commit and adds comments to the code hopefully explaining what is going on.
This should fix issues outlined in https://github.com/failsafe-lib/failsafe/issues/393 - and in fact it uses reproducer code provided there as an inspiration for the test.
Thanks!