Skip to content

fix(sdk): error callback should await shard flush on producer shutdown - #3953

Open
haubur wants to merge 1 commit into
apache:masterfrom
haubur:fix/producer-shutdown
Open

fix(sdk): error callback should await shard flush on producer shutdown#3953
haubur wants to merge 1 commit into
apache:masterfrom
haubur:fix/producer-shutdown

Conversation

@haubur

@haubur haubur commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR address?

Closes #3947

Rationale

On shutdown() the IggyProducer calls the shutdown() method of the Dispatcher which broadcasts
a termination signal to it's workers. This immediately breaks the loop of the error callback task, which then
does not receive any errors from the final flush anymore.

What changed?

The error callback task does not receive the stop signal anymore. The channel is still open,
and shards can put errors in the queue. On join in shutdown() (after shard tasks are joined) the
error callback is awaited for as long as the queue is emptied.

Local Execution

  • Passed
  • Pre-commit hooks ran

AI Usage

Test proposed by Claude code.

@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 22, 2026
@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.23810% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.68%. Comparing base (cc269ef) to head (46b853f).

Files with missing lines Patch % Lines
core/sdk/src/clients/producer_dispatcher.rs 95.23% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #3953       +/-   ##
=============================================
- Coverage     83.85%   69.68%   -14.17%     
  Complexity     1358     1358               
=============================================
  Files          1212     1212               
  Lines        166843   142805    -24038     
  Branches     134304   110392    -23912     
=============================================
- Hits         139905    99516    -40389     
- Misses        23298    39504    +16206     
- Partials       3640     3785      +145     
Components Coverage Δ
Rust Core 67.04% <95.23%> (-17.59%) ⬇️
Java SDK 66.67% <ø> (ø)
C# SDK 75.00% <ø> (-1.52%) ⬇️
Python SDK 90.13% <ø> (ø)
PHP SDK 84.48% <ø> (ø)
Node SDK 95.84% <ø> (ø)
Go SDK 54.54% <ø> (-13.84%) ⬇️
Files with missing lines Coverage Δ
core/sdk/src/clients/producer_dispatcher.rs 94.53% <95.23%> (+0.56%) ⬆️

... and 391 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): producer shutdown() error_callback is closed immediately, misses potential flush failures

1 participant