bolshakov / stoplight

:traffic_light: Traffic control for code.
http://bolshakov.github.io/stoplight/
MIT License
384 stars 40 forks source link

fix: Duplicated notifications #159

Closed Lokideos closed 1 year ago

Lokideos commented 1 year ago

If several instances use the same circuit breaker for connection to third-party service, they may fire duplicated notifications if the connection is unstable. This PR aims to fix it by introducing notification locks to allow only one notification of the same type to fire across service instances. It will not work if services do not share the data state between them (e.g., if they use the Memory data store type and run instances in separate processes/on separate machines).


Fixes #125 Fixes https://github.com/bolshakov/stoplight/issues/116

Lokideos commented 1 year ago

@bolshakov I changed the locking mechanism, and I think it's ready for review.