Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enables cancellation on async InjectLatency monkey. #44

Merged
merged 4 commits into from
Jul 28, 2019

Conversation

vany0114
Copy link
Member

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.

@vany0114 vany0114 requested a review from reisenberger July 27, 2019 02:09
@reisenberger
Copy link
Member

Hey @vany0114 PR looks good for async!

Re:

when we're not honoring the token in sync latency monkey, the injection of latency doesn't [currently] cancel actually (using an optimistic timeout), but when it finish injecting the latency it fails because the token was signaled from timeout policy.

[...] I was left wondering if we should allow that latency could be canceled even in sync scenarios

I agree, good suggestion 👍 to switch to injected sync latency also being cancellable. It makes symmetry between the sync and async cases, which is easier for users to understand.

Like you say, we could later introduce a bool isCancellable option on the InjectLatency policies, as originally discussed in #20.

Sounds good to me!

@vany0114 vany0114 merged commit 4b31287 into v0_2 Jul 28, 2019
@vany0114 vany0114 self-assigned this Jul 30, 2019
@vany0114 vany0114 added this to the V0.2 milestone Jul 30, 2019
@vany0114 vany0114 deleted the vany0114-latency-cancellable branch January 4, 2020 22:04
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.

2 participants