-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unconditionally call setException for RejectedExecutionException.
Under JDK11, the write to thrownByExecute / thrownFromDelegate is upsetting TSAN. I *suspect* that TSAN is incorrect (and that it is likely to identify the same "problem" in other code). However, we years ago questioned whether the code I'm removing served any real purpose... (fixes #2877) ...so now seems like a good time to get rid of it and, at minimum, hopefully eliminate the current TSAN failure. The code that we're running in the executor is under our control. (That is, we're the ones who implement Runnable.run().) We're catching exceptions (and thus any RejectedExecutionException) in the obvious places. Occasionally we do call listeners, but naturally we do that only after completing the future or at least calling setFuture (after which a stray setException(rejectedExecutionException) would be a no-op). The one(?) exception to that is that InterruptibleTask.run() can call currentThread.interrupt(), which we learned a few years ago can call arbitrary code through nio callbacks. At some point, though, I throw my hands up and say "whatever." (If the interrupt were to be a problem, it would have to be with an executor that executes tasks inline, like directExecutor. But I note that rejectionPropagatingExecutor, at least, already defends against this for directExecutor itself (by skipping the RejectedExecutionException logic entirely). So the danger exists only with CombinedFutureInterruptibleTask or with a non-directExecutor that can execute tasks inline without catching exceptions -- and again, only in concert with nio interrupt callbacks. I think.) RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=321374425
- Loading branch information
Showing
4 changed files
with
8 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters