Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.9.0
-
None
-
None
Description
The `shouldThrowStreamsExceptionOnStartupIfExceptionOccurred` test expects `
globalStreamThread.start` throws `startupException` when startup fails. This may not be true in some slow machines.
class GlobalStreamThread { Exception startupException; void initialize() { try { ... } catch (Exception e) { startupException = e; } ... setState(State.DEAD); } void start() { super.start(); while (stillInitializing()) { Utils.sleep(1); if (startupException != null) { throw startupexception; } } if (inErrorState()) { throw new IllegalStateException("Initialization for the global stream thread failed"); } } }
Consider the following schedule:
main:start:`startupException != null` GlobalStreamThread:initialize:`startupException = e;` GlobalStreamThread:initialize:`setState(State.DEAD);` main:start:`inErrorState()` main:start:`throw new IllegalStateException`
The function throws `IllegalStateException("Initialization for the global stream thread failed")` instead of `startupexception`
Attachments
Issue Links
- is fixed by
-
KAFKA-17100 GlobalStreamThread#start should not busy-wait
- Resolved