Enables cancellation on async InjectLatency monkey. #44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @reisenberger
I'm honoring the
CancellationToken
passed thru the execution when we're injecting the latency on the async monkeys to allow latency cancellation.However, there's an issue with the validations that I put in the previous PR on the Sync policies, more specifically here. Thing is that even when we're not honoring the token in sync latency monkey, the injection of latency doesn't cancel actually (using an optimistic timeout), but when it finish injecting the latency it fails because the token was signaled from timeout policy.
It might be fixed when we implement your propose about allowing the user to decide whether the operation is cancellable or not. However, I was left wondering if we should allow that latency could be canceled even in sync scenarios given that Simmy allows cancellation for the rest of policies, (like Polly does too) I mean, what might be the reason to doesn't allow the user to cancel the latency in sync scenarios?
Thoughts?
Ref: #20
Note: Sorry about formatting diffs.