Skip to content

fix flush_in_progress not visible to sender #2660

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 2 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions kafka/producer/record_accumulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def ready(self, cluster, now=None):
expired = bool(waited_time >= time_to_wait)

sendable = (full or expired or self._closed or
self._flush_in_progress())
self.flush_in_progress())

if sendable and not backing_off:
ready_nodes.add(leader)
Expand Down Expand Up @@ -563,7 +563,7 @@ def deallocate(self, batch):
"""Deallocate the record batch."""
self._incomplete.remove(batch)

def _flush_in_progress(self):
def flush_in_progress(self):
"""Are there any threads currently waiting on a flush?"""
return self._flushes_in_progress.get() > 0

Expand Down
4 changes: 2 additions & 2 deletions kafka/producer/transaction_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,11 @@ def producer_epoch(self):
return self.transaction_manager.producer_id_and_epoch.epoch

def fatal_error(self, exc):
self.transaction_manager._transition_to_fatal_error(exc)
self.transaction_manager.transition_to_fatal_error(exc)
self._result.done(error=exc)

def abortable_error(self, exc):
self.transaction_manager._transition_to_abortable_error(exc)
self.transaction_manager.transition_to_abortable_error(exc)
self._result.done(error=exc)

def fail(self, exc):
Expand Down
Loading