InterruptedException ☕ Java

java.lang.InterruptedException (sleep interrupted)

A blocked thread (sleep, wait, join, queue take) was interrupted by another thread.

Seen on: Java

Meaning

Interruption is a cooperative cancellation signal (executor shutdown, Future.cancel). Swallowing it hides shutdown requests.

Common causes

  • Executor/application shutting down
  • Future.cancel(true)
  • Test framework interrupting threads

⚡ Quick fix

  1. Restore the flag: Thread.currentThread().interrupt() and exit the loop
  2. Don’t catch and ignore it

Detailed fix by platform

Java

  1. catch (InterruptedException e) { Thread.currentThread().interrupt(); return; }

How to diagnose

  1. Who — Which component interrupted the thread?
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.