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

fix: don't assert on unordered publishes after publish error #49

Merged
merged 4 commits into from Mar 23, 2020

Conversation

pradn
Copy link
Contributor

@pradn pradn commented Mar 20, 2020

Unordered batches that threw errors on invoking the publish RPC led to subsequent assertion failures in thread.py::publish(). These assertion failures were legitimate. Publish calls should not be called on batches that have already been committed. (In this case, they were committed and then returned an error.)

This pull request fixes the underlying issue by clearing out the UnorderedSequencer's _current_batch on commit(). This ensures that no subsequent publish() calls will be called on that batch since the reference to it is lost.

I add a new "test_publish_after_batch_error" test for this scenario.

The OrderedSequencer does not have this issue. On error, it cancels all batches and pauses the ordering key. The existing "test_batch_done_unsuccessfully" test captures this scenario.

Fixes #48

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 20, 2020
@pradn pradn changed the title fix: allow unordered publishes after publish error fix: don't assert on unordered publishes after publish error Mar 20, 2020
@pradn pradn added the automerge Merge the pull request once unit tests and other checks pass. label Mar 20, 2020
@plamut plamut removed the automerge Merge the pull request once unit tests and other checks pass. label Mar 20, 2020
@plamut
Copy link
Contributor

plamut commented Mar 20, 2020

(reviewing right now, will merge myself if all is fine and the CI is done by then)

@pradn
Copy link
Contributor Author

pradn commented Mar 20, 2020

(reviewing right now, will merge myself if all is fine and the CI is done by then)

Thanks Peter!

Copy link
Contributor

@plamut plamut left a comment

Choose a reason for hiding this comment

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

The fix works and the code looks good.

@plamut plamut added automerge Merge the pull request once unit tests and other checks pass. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Mar 20, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 20, 2020
@gcf-merge-on-green
Copy link

Your PR has attempted to merge for 3 hours. Please check that all required checks have passed, you have an automerge label, and that all your reviewers have approved the PR

2 similar comments
@gcf-merge-on-green
Copy link

Your PR has attempted to merge for 3 hours. Please check that all required checks have passed, you have an automerge label, and that all your reviewers have approved the PR

@gcf-merge-on-green
Copy link

Your PR has attempted to merge for 3 hours. Please check that all required checks have passed, you have an automerge label, and that all your reviewers have approved the PR

@gcf-merge-on-green
Copy link

Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, or one of your required reviews was not approved. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot.

@pradn pradn merged commit ea19ce6 into googleapis:master Mar 23, 2020
@pradn pradn deleted the fix_assert branch March 23, 2020 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge the pull request once unit tests and other checks pass. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

asserting throwing for async publish with currently errored batch
5 participants