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: Revert change when consumer is paused #297

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions arroyo/processing/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,19 +338,19 @@ def _run_once(self) -> None:

message_carried_over = self.__message is not None

if self.__is_paused:
if message_carried_over:
# If a message was carried over from the previous run, there are two reasons:
#
# * MessageRejected. the consumer should be paused and not
# returning any messages on ``poll``.
# * InvalidMessage. the message should be resubmitted.
# _handle_invalid_message is responsible for clearing out
# self.__message if it was the invalid one.
if self.__consumer.poll(timeout=0) is not None:
if self.__is_paused and self.__consumer.poll(timeout=0) is not None:
raise InvalidStateError(
"received message when consumer was expected to be paused"
)
elif not message_carried_over:
else:
# Otherwise, we need to try fetch a new message from the consumer,
# even if there is no active assignment and/or processing strategy.
try:
Expand Down
Loading