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

Change Feed - CancellationToken not flowing into the pipeline #2478

Closed
ealsur opened this issue May 18, 2021 · 2 comments · Fixed by #2490
Closed

Change Feed - CancellationToken not flowing into the pipeline #2478

ealsur opened this issue May 18, 2021 · 2 comments · Fixed by #2490
Labels
bug Something isn't working ChangeFeed

Comments

@ealsur
Copy link
Member

ealsur commented May 18, 2021

After the refactoring in #1933, the user CancellationToken on ReadNexAsync is not flowing into the pipeline.

https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs#L250-L253

CrossPartitionChangeFeedAsyncEnumerator enumerator = monadicEnumerator.Result;
if (!await enumerator.MoveNextAsync(trace))
{
	throw new InvalidOperationException("ChangeFeed enumerator should always have a next continuation");
}

This means that if the CancellationToken cancels, it is not stopping any of the pipeline operations (like retries).

@ealsur ealsur added bug Something isn't working ChangeFeed labels May 18, 2021
@maryammadzadeh
Copy link

I am currently investigating a similar issue. Would this also cause the cancellation tokens to change for the retries?

@ealsur
Copy link
Member Author

ealsur commented May 21, 2021

@maryammadzadeh Since the CancellationToken does not flow through, if a particular ReadNextAsync call has retries (for example, the call hits 429s) and the CancellationToken cancels in-between, then the SDK will retry and the CancellationToken won't stop the retries, if any.

This bug is only for ChangeFeedIterator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ChangeFeed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants