Skip to content

fix offset safety, rebalance handling, and commit error handling#9

Merged
lesnik512 merged 1 commit intomainfrom
fix-concurrent-processing-bugs
Apr 14, 2026
Merged

fix offset safety, rebalance handling, and commit error handling#9
lesnik512 merged 1 commit intomainfrom
fix-concurrent-processing-bugs

Conversation

@lesnik512
Copy link
Copy Markdown
Member

  • batch_committer: stop advancing offsets at the first cancelled task per partition so messages aborted mid-flight are not silently skipped on restart
  • batch_committer: separate CommitFailedError (rebalance, ignore) from KafkaError (transient, re-queue) so a terminal error no longer spins forever
  • batch_committer: add _stop_requested flag so commit_all() flushes without stopping the loop (safe for rebalance), while close() still shuts it down
  • processing: remove redundant observer task — the _finish_task done-callback already discards completed tasks immediately, making the observer a no-op
  • rebalance: add ConsumerRebalanceListener that calls commit_all() on on_partitions_revoked to prevent duplicate processing after reassignment; accessible via KafkaConcurrentHandler.create_rebalance_listener()
  • tests: cover all new behaviours; 100% branch coverage on changed modules

- batch_committer: stop advancing offsets at the first cancelled task per
  partition so messages aborted mid-flight are not silently skipped on restart
- batch_committer: separate CommitFailedError (rebalance, ignore) from
  KafkaError (transient, re-queue) so a terminal error no longer spins forever
- batch_committer: add _stop_requested flag so commit_all() flushes without
  stopping the loop (safe for rebalance), while close() still shuts it down
- processing: remove redundant observer task — the _finish_task done-callback
  already discards completed tasks immediately, making the observer a no-op
- rebalance: add ConsumerRebalanceListener that calls commit_all() on
  on_partitions_revoked to prevent duplicate processing after reassignment;
  accessible via KafkaConcurrentHandler.create_rebalance_listener()
- tests: cover all new behaviours; 100% branch coverage on changed modules
@lesnik512 lesnik512 self-assigned this Apr 14, 2026
@lesnik512 lesnik512 merged commit 055e8b7 into main Apr 14, 2026
5 checks passed
@lesnik512 lesnik512 deleted the fix-concurrent-processing-bugs branch April 14, 2026 08:44
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.

1 participant