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(filter): Handle MessageRejected correctly (INC-584) #313

Merged
merged 2 commits into from
Dec 8, 2023

Conversation

untitaker
Copy link
Member

When joining a FilterStep, it can happen that the upstream strategy
raises MessageRejected. We need to deal with that somehow, and in this
PR I'm just suppressing that exception.

Also fix a severe bug where MessageRejected was propagated through
submit(), but the MessageRejected was for the wrong message, causing
double-submission of messages.

When joining a FilterStep, it can happen that the upstream strategy
raises MessageRejected. We need to deal with that somehow, and in this
PR I'm just suppressing that exception.

Also fix a severe bug where MessageRejected was propagated through
submit(), but the MessageRejected was for the wrong message, causing
double-submission of messages.
@untitaker untitaker requested a review from a team as a code owner December 8, 2023 00:04
@untitaker untitaker changed the title fix(filter): Handle MessageRejected correctly fix(filter): Handle MessageRejected correctly (INC-584) Dec 8, 2023
Comment on lines 92 to 96
if policy is not None and policy.should_commit(now, self.__uncommitted_offsets):
# We cannot let MessageRejected propagate here. The caller will
# think it is for `message` (which has already been successfully
# submitted), and will double-send it.
self.__flush_uncommitted_offsets(now, can_backpressure=False)
Copy link
Member

Choose a reason for hiding this comment

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

I think this can be removed since you flush on line 78-79 now

Copy link
Member Author

Choose a reason for hiding this comment

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

I added this so that the tests continue to pass. But the tests were just overly strict in the behavior we assert. We don't actually need this exact behavior where should_commit is called after every submit

@untitaker untitaker merged commit 9f00391 into main Dec 8, 2023
8 checks passed
@untitaker untitaker deleted the fix/filtered-messages-join-backpressure branch December 8, 2023 00:34
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

2 participants