Skip to content

Conversation

@afprtclr
Copy link
Contributor

A port of Particular/NServiceBus.Transport.AzureServiceBus#1066

Serializing the arm/disarm actions is not enough. The state transition preceding the arm/disarm action must be captured in the lock as well, otherwise the state transitions could happen properly but then the arm/disarm actions could be executed by the processor in the wrong order, leaving the logic of the circuit breaker itself intact but the consequences of the arm/disarm actions in an incorrect state.

I also added xdoc as a way to document that the arm/disarm actions are called within a lock, and to maybe pave the way for this to be used as a shared component.

@afprtclr afprtclr force-pushed the feature/repeated-failures-port branch 3 times, most recently from a2e489e to 7d9a2d6 Compare June 12, 2025 10:44
@afprtclr afprtclr force-pushed the feature/repeated-failures-port branch from 7d9a2d6 to 4980448 Compare June 12, 2025 11:04
@afprtclr afprtclr merged commit 7fc8c05 into master Jun 13, 2025
4 checks passed
@afprtclr afprtclr deleted the feature/repeated-failures-port branch June 13, 2025 08:49
@afprtclr afprtclr modified the milestones: 13.0.3, 12.0.4 Jun 13, 2025
@afprtclr afprtclr changed the title Fix race condition in RepeatedFailuresOverTimeCircuitBreaker Send failures could lock transport into single concurrency mode Jun 17, 2025
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.

3 participants