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

@pradn pradn requested review from plamut and kamalaboulhosn 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
@plamut
Copy link
Contributor

@plamut plamut commented Mar 20, 2020

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

Loading

@pradn
Copy link
Contributor Author

@pradn pradn commented Mar 20, 2020

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

Thanks Peter!

Loading

plamut
plamut approved these changes Mar 20, 2020
Copy link
Contributor

@plamut plamut left a comment

The fix works and the code looks good.

Loading

@gcf-merge-on-green
Copy link

@gcf-merge-on-green gcf-merge-on-green bot commented Mar 21, 2020

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

Loading

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

@gcf-merge-on-green gcf-merge-on-green bot commented Mar 21, 2020

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

Loading

@gcf-merge-on-green
Copy link

@gcf-merge-on-green gcf-merge-on-green bot commented Mar 21, 2020

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

Loading

@gcf-merge-on-green
Copy link

@gcf-merge-on-green gcf-merge-on-green bot commented Mar 21, 2020

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.

Loading

@pradn pradn merged commit ea19ce6 into googleapis:master Mar 23, 2020
3 checks passed
Loading
@pradn pradn deleted the fix_assert branch Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants