arnabnandy7 opened a new pull request, #22910:
URL: https://github.com/apache/kafka/pull/22910
## Description
KAFKA-20819 reports that a `StreamThread` can block while waiting for a
task-removal future after its `StateUpdaterThread` has terminated. Requests
submitted to the stopped updater were left unprocessed, and their futures could
remain incomplete.
This change makes state-updater failure explicit and prevents callers from
waiting on requests that cannot be processed:
- Marks the state updater as stopped on every thread exit path.
- Logs fatal `Error`s through the configured logger before rethrowing them.
- Completes pending task-removal futures exceptionally when the updater
exits.
- Rejects task additions after an already-started updater has stopped.
- Returns an exceptionally completed future for task removals submitted
after the updater has stopped.
- Preserves the existing ability to enqueue tasks before the updater starts
and to restart it after a clean shutdown.
No public API, configuration, metrics, or compatibility behavior is changed.
## Testing
Added unit tests covering:
- Requests submitted after the state updater terminates with a fatal error.
- A removal request queued while the updater is running but still pending
when the updater terminates.
Ran:
```
./gradlew :streams:spotlessJavaApply :streams:test \
--tests
org.apache.kafka.streams.processor.internals.DefaultStateUpdaterTest
```
This also ran the relevant Streams compilation, Checkstyle, and SpotBugs
tasks. All tests passed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]