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

StackOverflow Error in FeedResponse.ReadNextAsync When Token is Cancelled #4658

Open
eugeneogongo opened this issue Sep 2, 2024 · 0 comments
Labels
customer-reported Issue created by a customer needs-investigation

Comments

@eugeneogongo
Copy link

eugeneogongo commented Sep 2, 2024

We are continuously addressing and improving the SDK, if possible, make sure the problem persist in the latest SDK version.

Describe the bug
When FeedResponse.ReadNextAsync(token) is invoked for a long-running query that returns approximately 500 items, a StackOverflowException occurs if the cancellation token is triggered during the execution. The issue seems to be related to the handling of cancellation during lengthy operations.

To Reproduce
Execute a query that retrieves around 500 items, ensuring that the query takes a considerable amount of time to complete.
While FeedResponse.ReadNextAsync(token) is processing the query, trigger the cancellation token.
Observe the behavior of the application.

Expected behavior
The method ReadNextAsync should handle the cancellation request without causing a StackOverflowException. It should properly cancel the ongoing task and throw a TaskCanceledException or complete in a controlled manner.
Actual behavior
Triggering the cancellation token during the execution of a long-running ReadNextAsync call results in a StackOverflowException. This suggests that the cancellation process might be causing recursive calls or excessive stack usage, particularly during prolonged operations.

Environment summary
SDK Version: 3.42.0
OS Version (e.g. Windows, Linux, MacOSX): Windows

Additional context
Link to CallDump (MS FTE login required): Azure Watson Dump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issue created by a customer needs-investigation
Projects
None yet
Development

No branches or pull requests

1 participant