Suppress interrupted status during pool closure#13521
Suppress interrupted status during pool closure#13521werkt wants to merge 1 commit intobazelbuild:masterfrom
Conversation
awaitTermination will throw InterruptedException if the interrupted status is set initially when it is called, even if no wait is required. Pool closure should not respect active interrupted status when shutting down and awaiting termination as a result of its call from executionPhaseEnding, which will occur during abnormal exits from ExecutionTool. Ignore this status initially and restore the flag upon exit of the factory close. An external interrupt which occurs during the awaitTermination will still trigger an InterruptedException, as expected. Fixes bazelbuild#13512
awaitTermination will throw InterruptedException if the interrupted status is set initially when it is called, even if no wait is required. Pool closure should not respect active interrupted status when shutting down and awaiting termination as a result of its call from executionPhaseEnding, which will occur during abnormal exits from ExecutionTool. Ignore this status initially and restore the flag upon exit of the factory close. An external interrupt which occurs during the awaitTermination will still trigger an InterruptedException, as expected. Fixes #13512 Closes #13521. PiperOrigin-RevId: 377006347
|
@werkt If there was an InterruptedException during the That seems to be the case we hit below. Bazel version is 6.1.0. The line in the stack trace |
|
Yes, from your stack traces there, and from confirming via code sources, I expect that, particularly given the block of submittedTasks processing in BlockWaitingModule, only AbruptExitExceptions are handled in any non-terminating fashion, with your Interrupted -> IO -> Assertion -> Execution -> Runtime exception path there resulting in a shutdown in BlazeCommandDispatcher with the copy "Shutting down due to exception". Ostensibly, you really don't want anything but a complete failure+shutdown in the bazel daemon here, as it just failed to shutdown a pool, so it would leak resources if it continued. |
|
Roger. Thanks for confirming. |
awaitTermination will throw InterruptedException if the interrupted
status is set initially when it is called, even if no wait is required.
Pool closure should not respect active interrupted status when shutting
down and awaiting termination as a result of its call from
executionPhaseEnding, which will occur during abnormal exits from
ExecutionTool. Ignore this status initially and restore the flag upon
exit of the factory close. An external interrupt which occurs during the
awaitTermination will still trigger an InterruptedException, as
expected.
Fixes #13512