-
Notifications
You must be signed in to change notification settings - Fork 44
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
Fix a bug in cooperative cancellation for Polling Services causing a request to time out to quickly #558
Conversation
@@ -59,13 +59,6 @@ public static LatestClientAndLatestServiceBuilder WithInstantReconnectPollingRet | |||
{ | |||
return builder.WithPollingReconnectRetryPolicy(() => new RetryPolicy(1, TimeSpan.Zero, TimeSpan.Zero)); | |||
} | |||
|
|||
public static LatestClientAndLatestServiceBuilder WhenTestingAsyncClient(this LatestClientAndLatestServiceBuilder builder, ClientAndServiceTestCase clientAndServiceTestCase, Action<LatestClientAndLatestServiceBuilder> action) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed as everything is Async
{ | ||
return false; | ||
} | ||
|
||
using (await transferLock.LockAsync(CancellationToken.None)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure there is no race condition allowing a just cancelled request to be dequeued
if (completed) | ||
// Check if the request has already been completed or if the request has been cancelled | ||
// to ensure we don't dequeue an already completed or already cancelled request | ||
if (completed || pendingRequestCancellationTokenSource.IsCancellationRequested) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure there is no race condition allowing a just cancelled request to be dequeued
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…led before it should be
84b11a9
to
a3427ee
Compare
Background
This PR fixes a bug in cooperative cancellation for Polling Requests which cause the transferring request to be cancelled after the PollingRequestQueueTimeout rather than waiting for the PollingRequestMaximumMessageProcessingTimeout
[sc-58429]
How to review this PR
Quality ✔️
Pre-requisites