-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug where wrong context is passed to circuit breaker
On `Done`, the circuit breaker library checks the `ctx` error separately from the error that is passed in along with the context. Separately, it is also configured to not fail on context cancelled. On scatter gather, a new context with cancel is created with some max wait time and then passed to the function to perform the action. The fix here passes the same context as the one passed to do the action to the circuit breaker `Done` function so that the config for context cancellation is respected. The changes here also improve context handling in scatter gather such that as soon as the processing is finished the context is cancelled, and all channels are closed up properly without the need for draining when context is done.
- Loading branch information
Showing
4 changed files
with
104 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters