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

Query: Fixes stack overflow in SkipEmptyPageQueryPipelineStage #2851

Merged
merged 3 commits into from Nov 4, 2021

Conversation

neildsh
Copy link
Contributor

@neildsh neildsh commented Nov 3, 2021

Description

The current implementation of SkipEmptyPageQueryPipelineStage.MoveNextAsync recursively calls itself if the previous pipeline stage emits an empty page. This leads to stack overflow if there are too many empty pages or if an inner pipeline stage throws from a deeply nested stack. This change refactors the implementation to be iterative rather than recursive and adds unit tests for SkipEmptyPageQueryPipelineStage which previously had none.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Closing issues

To automatically close an issue: closes #IssueNumber

Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Thanks

@j82w j82w changed the title [Internal] Query: Fixes stack overflow in SkipEmptyPageQueryPipelineStage Query: Fixes stack overflow in SkipEmptyPageQueryPipelineStage Nov 3, 2021
Copy link
Contributor

@sboshra sboshra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@sboshra sboshra merged commit 5dcaf20 into master Nov 4, 2021
@sboshra sboshra deleted the users/ndeshpan/stackoverflow branch November 4, 2021 04:06
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.

None yet

5 participants