Skip to content

fix(sdk): stream should terminate after consumer shutdown - #3964

Open
haubur wants to merge 1 commit into
apache:masterfrom
haubur:fix/polling-after-consumer-shutdown
Open

fix(sdk): stream should terminate after consumer shutdown#3964
haubur wants to merge 1 commit into
apache:masterfrom
haubur:fix/polling-after-consumer-shutdown

Conversation

@haubur

@haubur haubur commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR address?

Closes #3910

Rationale

After consumer.shutdown() calling consumer.next() was still possible. Causing

  • for a standalone consumer to poll fresh from the server, while storing offsets was unreachable due to dropping the channel on shutdown()
  • for a consumer group to hang indefinitely while trying to build a new poll future

What changed?

When writing the issue I said that the preferred way would be to return an IggyError to allow user handling.
However, calling next() on a shut down consumer now returns: Poll::Ready(None) indicating a terminated stream as intended by the futures crate: https://docs.rs/futures/latest/futures/prelude/trait.Stream.html#:~:text=Poll%3A%3AReady%28None%29%20means%20that%20the%20stream%20has%20terminated%2C%20and%20poll%5Fnext%20should%20not%20be%20invoked%20again

Local Execution

  • Passed
  • Pre-commit hooks ran

@github-actions

Copy link
Copy Markdown

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Aug 25, 2026
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.10345% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.85%. Comparing base (1a98748) to head (8a1ee5f).

Files with missing lines Patch % Lines
core/sdk/src/clients/consumer.rs 93.10% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #3964       +/-   ##
=============================================
- Coverage     83.99%   69.85%   -14.14%     
  Complexity     1358     1358               
=============================================
  Files          1215     1215               
  Lines        170548   146083    -24465     
  Branches     138292   113829    -24463     
=============================================
- Hits         143252   102049    -41203     
- Misses        23439    40131    +16692     
- Partials       3857     3903       +46     
Components Coverage Δ
Rust Core 66.60% <93.10%> (-18.29%) ⬇️
Java SDK 66.67% <ø> (ø)
C# SDK 74.96% <ø> (ø)
Python SDK 90.13% <ø> (ø)
PHP SDK 84.48% <ø> (ø)
Node SDK 95.90% <ø> (+0.09%) ⬆️
Go SDK 68.29% <ø> (ø)
Files with missing lines Coverage Δ
core/sdk/src/clients/consumer.rs 77.05% <93.10%> (+5.27%) ⬆️

... and 317 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(Rust SDK): IggyConsumer::next() after shutdown() hangs or silently drops offsets

1 participant