java.util.concurrent.RejectedExecutionException: Endpoint is not open

JBoss Issue Tracker | Ladislav Thon | 2 years ago
  1. 0

    In one of our tests, we've seen this exception during server shutdown: {code} 2015-06-05 10:34:44,387 ERROR [org.xnio.listener] (XNIO-1 I/O-2) XNIO001007: A channel event listener threw an exception: java.util.concurrent.RejectedExecutionException: Task org.jboss.remoting3.remote.RemoteReadListener$1$1@5e7925db rejected from org.xnio.XnioWorker$TaskPool@3d00aa37[Shutting down, pool size = 7, active threads = 0, queued tasks = 0, completed tasks = 52] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution( at java.util.concurrent.ThreadPoolExecutor.reject( at java.util.concurrent.ThreadPoolExecutor.execute( at org.xnio.XnioWorker.execute( at org.jboss.remoting3.remote.RemoteReadListener$1.handleEvent( ... {code} This is a very basic test that only starts the server and then shuts it down using {{:shutdown}}. After looking into this for a while, I believe that this is caused by the core management server ({{UndertowHttpManagementService}}) shutting down an XNIO worker (= thread pool) while the {{:shutdown}} management operation is still running (or, in fact, finishing, trying to close the network connection). I have a Byteman-based reproducer that inserts artifical pauses to certain well-defined places. I'm not sure if this has some connection to the graceful shutdown system, but I believe that even if it does, something like this shouldn't happen. Steps to reproduce: # {{./bin/ -c standalone-full-ha.xml}} and wait until it starts completely # {{jps -v | grep "\-D\\[Standalone\\]"}} to figure out the PID of the newly started server # {{ -b -Dorg.jboss.byteman.transform.all $PID}} # {{ reproducer.btm}}, where {{reproducer.btm}} is a Byteman script reproduced below # {{./bin/ -c}} # {{:read-resource}} repeat few times # {{:shutdown(timeout=1)}} (or plain {{:shutdown}}) The Byteman script: {code} RULE XnioWorker.TaskPool/ThreadPoolExecutor shutdown CLASS java.util.concurrent.ThreadPoolExecutor METHOD shutdown() AFTER INVOKE advanceRunState IF TRUE DO Thread.sleep(10000) ENDRULE RULE Remoting onClose handler CLASS org.jboss.remoting3.remote.RemoteReadListener$1 METHOD handleEvent(java.nio.channels.Channel) AT ENTRY IF TRUE DO Thread.sleep(5000) ENDRULE {code}

    JBoss Issue Tracker | 2 years ago | Ladislav Thon
    java.util.concurrent.RejectedExecutionException: Endpoint is not open
  2. 0

    Camel PollEnrich rejecting "file location" is not started, but in state: Stopped

    Stack Overflow | 2 years ago
    java.util.concurrent.RejectedExecutionException: PollingConsumer on Endpoint[file://portfolio-inbox/holding?noop=true] is not started, but in state: Stopped
  3. 0

    'Exit' doesn't work if sync is running.

    GitHub | 2 years ago | binwiederhier
    java.util.concurrent.RejectedExecutionException: XNIO007007: Thread is terminating
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    java.util.concurrent.RejectedExecutionException: Player is shut down

    GitHub | 2 years ago | Wolftein
    java.util.concurrent.RejectedExecutionException: Player is shut down

    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.util.concurrent.RejectedExecutionException

      Endpoint is not open

      at org.jboss.remoting3.EndpointImpl.executorUntick()
    2. JBoss Remoting
      1. org.jboss.remoting3.EndpointImpl.executorUntick(
      2. org.jboss.remoting3.EndpointImpl$TrackingExecutor.execute(
      3. org.jboss.remoting3.remote.RemoteReadListener$1.handleEvent(
      3 frames
    3. XNIO API
      1. org.xnio.ChannelListeners.invokeChannelListener(
      2. org.xnio.channels.TranslatingSuspendableChannel.close(
      3. org.xnio.IoUtils.safeClose(
      4. org.xnio.channels.TranslatingSuspendableChannel$3.handleEvent(
      5. org.xnio.ChannelListeners.invokeChannelListener(
      6. org.xnio.ChannelListeners$DelegatingChannelListener.handleEvent(
      7. org.xnio.ChannelListeners.invokeChannelListener(
      8. org.xnio.StreamConnection.invokeCloseListener(
      9. org.xnio.Connection.writeClosed(
      9 frames
    4. XNIO NIO Implementation
      1. org.xnio.nio.AbstractNioStreamConnection.writeClosed(
      2. org.xnio.nio.NioSocketConduit.terminateWrites(
      3. org.xnio.nio.NioSocketConduit.truncateWrites(
      3 frames
    5. org.xnio.conduits
      1. org.xnio.conduits.ConduitStreamSinkChannel.close(
      1 frame
    6. XNIO API
      1. org.xnio.IoUtils.safeClose(
      1 frame
    7. org.xnio.conduits
      1. org.xnio.conduits.WriteReadyHandler$ChannelListenerHandler.forceTermination(
      1 frame
    8. XNIO NIO Implementation
      1. org.xnio.nio.NioSocketConduit.forceTermination(
      2 frames