Repository navigation
feat(python): expose consumer shutdown and offset drain timeout - #4660
Draft
ParthibanRajasekaran wants to merge 7 commits into
Draft
ParthibanRajasekaran wants to merge 7 commits into
ParthibanRajasekaran wants to merge 7 commits into
Conversation
|
Note for maintainers: @ParthibanRajasekaran also has #4581 open. New contributors are asked to keep one open PR at a time. See CONTRIBUTING.md. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4660 +/- ##
============================================
+ Coverage 80.83% 80.86% +0.03%
Complexity 3107 3107
============================================
Files 1467 1467
Lines 356533 356549 +16
Branches 300421 300421
============================================
+ Hits 288194 288330 +136
+ Misses 61617 61375 -242
- Partials 6722 6844 +122
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR address?
Closes #4165.
Rationale
Python consumers can stop their consumption loop but cannot invoke the Rust consumer's final offset cleanup and group leave.
What changed?
await consumer.shutdown()delegates to the existing Rust consumer shutdown after consumption has stopped. An appended optionaloffset_drain_timeout: datetime.timedelta | Noneuses the existing duration conversion and preserves the Rust default when omitted or None. Generated types and documentation describe the supported call order and timeout semantics. Regression tests verify final stored offsets, group departure before an independently connected replacement resumes, concurrent/repeated shutdown, iterator termination and timeout inputs.The change is limited to five Python SDK files, in separate implementation, test and documentation commits.
Local Execution
Draft for tracking: separate Python BDD, README examples and the encryption-disabled Python CI leg still need confirmed local results. Author review of the rationale and explanation of the code is pending. This draft does not request maintainer review yet; the contributor's existing PR #4581 is still open.
AI Usage