Skip to content

Conversation

@Nikita-Shupletsov
Copy link
Contributor

@Nikita-Shupletsov Nikita-Shupletsov commented Nov 22, 2025

  • Improved error handling in DefaultStateUpdater to take potential
    failures in Task#maybeCheckpoint into account.
  • Improved TaskManager#shutdownStateUpdater to not hang indefinitely if
    the State Updater thread is dead.

Cherry-pick of #20767

Reviewers: Matthias J. Sax [email protected]

…20767)

- Improved error handling in DefaultStateUpdater to take potential
failures in Task#maybeCheckpoint into account.
- Improved TaskManager#shutdownStateUpdater to not hang indefinitely if
the State Updater thread is dead.

Reviewers: Matthias J. Sax <[email protected]>, Lucas Brutschy
 <[email protected]>

---------

Co-authored-by: Matthias J. Sax <[email protected]>

streams.removeStreamThread();

TestUtils.waitForCondition(() -> streams.state() == KafkaStreams.State.REBALANCING, TimeUnit.MINUTES.toMillis(2), "Streams never reached REBALANCING state");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this only for 4.1 branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for some reason in 4.1 branch rebalancing kicks in only after ~1 minute after the thread is removed. it didn't happen in trunk

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. Interesting. Did dig into this and found the root cause: ebae768#diff-ab27af136b0c45ed402ec44368a91380b018bf06f1a9722324fe6be8d5220f7dR1204

We can keep this condition (maybe reduce to 1 minute waiting time?), and additionally reduce session timeout to 10 sec to speed up the test?

W/o sending a leave group request, the test hangs waiting for session timeout to expire on missing heartbeats from the removed thread.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! it explains everything. updated the PR

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants