Skip to content

PHPLIB-443: Propagate non-resumable errors during ChangeStream iteration #618

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

Merged
merged 1 commit into from
Jun 18, 2019

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Jun 17, 2019

https://jira.mongodb.org/browse/PHPLIB-443

This PR is a single commit, but depends on #616.

The fifth prose test serves as a regression test for this bug.

@jmikola jmikola requested a review from kvwalker June 17, 2019 22:29

$this->expectException(ServerException::class);
$this->expectExceptionCode($errorCode);
$changeStream->rewind();
Copy link
Member Author

Choose a reason for hiding this comment

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

Since the initial aggregate returns an empty first batch, this rewind() is sufficient to invoke the first getMore by way of phongo_cursor_advance_and_check_for_error(), which calls mongoc_cursor_next().

Copy link
Contributor

@kvwalker kvwalker left a comment

Choose a reason for hiding this comment

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

looks good to me!

@jmikola
Copy link
Member Author

jmikola commented Jun 18, 2019

Rebased on master now that #616 has been merged.

@jmikola jmikola merged commit b2c5e8c into mongodb:master Jun 18, 2019
jmikola added a commit that referenced this pull request Jun 18, 2019
@jmikola jmikola deleted the phplib-443 branch June 18, 2019 21: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