Skip to main content
PreparationZone Logo
PreparationZone
Back to Java

Java · Medium · Pro

ExecutorService shutdown — awaitTermination and shutdownNow?

JavaConcurrencySenior
Model answerPreview

ExecutorService shutdown

Shutting down executors prevents thread leaks on redeploy. Call shutdown(), await completion, then shutdownNow() with timeout handling interrupted tasks.