In my application, I use ExecutorService a lot for making async calls.
ExecutorService executorService = Executors.newFixedThreadPool(10);
And I shutdown the executorService only when the app (web based) shuts down. Recently when debugging some issues I was looking through this code and wondering whether there can be cases during the execution of the program when I am forced to shutdown the ExecutorService and restart it i.e. new set of pooled threads. So I wanted to know what typical scenarios/unexpected application behavior can force me to do so?
The typical exceptions that I check for are ExecutionException, InterruptedException, CancellationException
but I don't do much apart from logging them.