-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppress interrupted status during pool closure #13521
Suppress interrupted status during pool closure #13521
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
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
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 Closes bazelbuild#13521. PiperOrigin-RevId: 377006347
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 Closes bazelbuild#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