-
Notifications
You must be signed in to change notification settings - Fork 50
OS-level thread exhaustion #173
Copy link
Copy link
Open
Description
If the OS runs out of native threads, the JDK's response is to throw an OutOfMemoryError from Thread#start. Presently, EnhancedQueueExecutor catches such errors and wraps them into a RejectedExecutionException (as a suppressed throwable).
We can take other actions as well, including (but not limited to):
- Propagating the error directly instead of wrapping it (I don't recommend this though)
- Passing the error to the default thread uncaught exception handler, in the hopes that it has some sensible policy (for example, maybe this would trigger "crash on OOME" on some JVMs; this would have to be tested though because by default it is just
null) (Update I just verified that there is no uncaught exception handler installed in this case, at least on Temurin) - Logging a warning
- Force a
System.abort()when caught (perhaps after logging a message, hopefully the log is autoflushing)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels