java.lang.InterruptedException JIRA | oleksiys | 3 years ago
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I'm working with a jersey server and want to be sure that when the server is terminated (usually via SIGTERM), all currently running requests are completed gracefully. If volume is high enough, there will likely be data loss if I don't do this. So I'm trying to call HttpServer.shutdown() from a runtime shutdown hook. I think it is working correctly, except for one problem. CompletionHandler.failed() is invoked, with an InterruptedException. shutdownNow is in the stack trace, so it seems like there is just some logical error occurring after the shutdown itself has finished: {code} java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly( at org.glassfish.grizzly.impl.SafeFutureImpl$Sync.innerGet( at org.glassfish.grizzly.impl.SafeFutureImpl.get( at org.glassfish.grizzly.impl.SafeFutureImpl.notifyCompletionHandlers( at org.glassfish.grizzly.impl.SafeFutureImpl.done( at org.glassfish.grizzly.impl.SafeFutureImpl$Sync.innerSet( at org.glassfish.grizzly.impl.SafeFutureImpl.result( at org.glassfish.grizzly.http.server.HttpServer.shutdownNow( at org.glassfish.grizzly.http.server.HttpServer$1.completed( at org.glassfish.grizzly.http.server.HttpServer$1.completed( at org.glassfish.grizzly.impl.SafeFutureImpl.notifyCompletionHandlers( at org.glassfish.grizzly.impl.SafeFutureImpl.done( at org.glassfish.grizzly.impl.SafeFutureImpl$Sync.innerSet( at org.glassfish.grizzly.impl.SafeFutureImpl.result( at org.glassfish.grizzly.http.server.NetworkListener$1$1.completed( at org.glassfish.grizzly.http.server.NetworkListener$1$1.completed( at org.glassfish.grizzly.http.server.HttpServerFilter.prepareForShutdown( at org.glassfish.grizzly.http.server.NetworkListener$1.shutdownRequested( at at java.util.concurrent.ThreadPoolExecutor.runWorker( at java.util.concurrent.ThreadPoolExecutor$ at {code} I boiled it down to this test case which does not use jersey or a shutdown hook. It's very simple and the same exception occurs (in fact, the above is copied from the output of this program): {code} public class Server { public static void main(String[] args) throws IOException { HttpServer server = HttpServer.createSimpleServer(); server.start(); try { Thread.sleep(5000); } catch (InterruptedException ex) {} shutdown(server); } public static void shutdown (HttpServer server) { final boolean [] done = {false}; server.shutdown().addCompletionHandler(new EmptyCompletionHandler<HttpServer>() { public void completed (HttpServer arg) { System.out.println("Shutdown completed"); done[0] = true; } public void failed (Throwable error) { System.out.println("Shutdown failed"); error.printStackTrace(System.out); done[0] = true; } }); while (!done[0]) { try { Thread.sleep(100); } catch (InterruptedException ex) {} } System.out.println("Goodbye"); } } {code} JIRA | 3 years ago | oleksiys
  2. 0

    GitHub comment 1635#251458269

    GitHub | 5 months ago | tcarette
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Adding new files while scanning could raise a non caught exception

    GitHub | 3 years ago | dadoonet
    org.elasticsearch.ElasticsearchIllegalStateException: Future got interrupted

  1. tyson925 36 times, last 4 weeks ago
  2. Handemelindo 2 times, last 5 months ago
5 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.InterruptedException

    No message provided

    at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly()
  2. Java RT
    1. java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(
    1 frame
  3. Grizzly
    1. org.glassfish.grizzly.impl.SafeFutureImpl$Sync.innerGet(
    2. org.glassfish.grizzly.impl.SafeFutureImpl.get(
    3. org.glassfish.grizzly.impl.SafeFutureImpl.notifyCompletionHandlers(
    4. org.glassfish.grizzly.impl.SafeFutureImpl.done(
    5. org.glassfish.grizzly.impl.SafeFutureImpl$Sync.innerSet(
    6. org.glassfish.grizzly.impl.SafeFutureImpl.result(
    6 frames
  4. Grizzly Server
    1. org.glassfish.grizzly.http.server.HttpServer.shutdownNow(
    2. org.glassfish.grizzly.http.server.HttpServer$1.completed(
    3. org.glassfish.grizzly.http.server.HttpServer$1.completed(
    3 frames
  5. Grizzly
    1. org.glassfish.grizzly.impl.SafeFutureImpl.notifyCompletionHandlers(
    2. org.glassfish.grizzly.impl.SafeFutureImpl.done(
    3. org.glassfish.grizzly.impl.SafeFutureImpl$Sync.innerSet(
    4. org.glassfish.grizzly.impl.SafeFutureImpl.result(
    4 frames
  6. Grizzly Server
    1. org.glassfish.grizzly.http.server.NetworkListener$1$1.completed(
    2. org.glassfish.grizzly.http.server.NetworkListener$1$1.completed(
    3. org.glassfish.grizzly.http.server.HttpServerFilter.prepareForShutdown(
    4. org.glassfish.grizzly.http.server.NetworkListener$1.shutdownRequested(
    4 frames
  7. Grizzly
    1 frame
  8. Java RT
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(
    2. java.util.concurrent.ThreadPoolExecutor$
    3 frames