java.util.concurrent.RejectedExecutionException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I noticed the following exception rarely being raised when closing a Cluster instance at times: {noformat} java.util.concurrent.RejectedExecutionException: Task com.google.common.util.concurrent.ListenableFutureTask@44d138e5 rejected from java.util.concurrent.ThreadPoolExecutor@3ee65af[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 3] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) at com.google.common.util.concurrent.MoreExecutors$ListeningDecorator.execute(MoreExecutors.java:480) at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:49) at com.datastax.driver.core.Cluster$Manager.triggerOnDown(Cluster.java:1726) at com.datastax.driver.core.Cluster$Manager.signalConnectionFailure(Cluster.java:2037) at com.datastax.driver.core.Connection.closeAsync(Connection.java:619) at com.datastax.driver.core.HostConnectionPool.discardAvailableConnections(HostConnectionPool.java:628) at com.datastax.driver.core.HostConnectionPool.closeAsync(HostConnectionPool.java:606) at com.datastax.driver.core.SessionManager.closeAsync(SessionManager.java:160) at com.datastax.driver.core.Cluster$Manager.close(Cluster.java:1576) at com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:1261) at com.datastax.driver.core.Cluster.closeAsync(Cluster.java:552) at com.datastax.driver.core.Cluster.close(Cluster.java:563) at com.datastax.driver.core.policies.DCAwareRoundRobinPolicyTest.should_not_use_remote_hosts_if_some_nodes_are_up_in_local_dc(DCAwareRoundRobinPolicyTest.java:149) {noformat} I think this is a small side effect of calling signalConnectionFailure being moved from {{Connection#defunct}} to {{Connection#closeAsync}} in [JAVA-966]. We should check in the triggerOn* methods like we do in the on* methods to see if the cluster is closed/closing before submitting to the executor. In theory there still might be a very thin window where the executor is shutdown between a condition check and submitting the Task.
    via by Andy Tolbert,
  • I noticed the following exception rarely being raised when closing a Cluster instance at times: {noformat} java.util.concurrent.RejectedExecutionException: Task com.google.common.util.concurrent.ListenableFutureTask@44d138e5 rejected from java.util.concurrent.ThreadPoolExecutor@3ee65af[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 3] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) at com.google.common.util.concurrent.MoreExecutors$ListeningDecorator.execute(MoreExecutors.java:480) at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:49) at com.datastax.driver.core.Cluster$Manager.triggerOnDown(Cluster.java:1726) at com.datastax.driver.core.Cluster$Manager.signalConnectionFailure(Cluster.java:2037) at com.datastax.driver.core.Connection.closeAsync(Connection.java:619) at com.datastax.driver.core.HostConnectionPool.discardAvailableConnections(HostConnectionPool.java:628) at com.datastax.driver.core.HostConnectionPool.closeAsync(HostConnectionPool.java:606) at com.datastax.driver.core.SessionManager.closeAsync(SessionManager.java:160) at com.datastax.driver.core.Cluster$Manager.close(Cluster.java:1576) at com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:1261) at com.datastax.driver.core.Cluster.closeAsync(Cluster.java:552) at com.datastax.driver.core.Cluster.close(Cluster.java:563) at com.datastax.driver.core.policies.DCAwareRoundRobinPolicyTest.should_not_use_remote_hosts_if_some_nodes_are_up_in_local_dc(DCAwareRoundRobinPolicyTest.java:149) {noformat} I think this is a small side effect of calling signalConnectionFailure being moved from {{Connection#defunct}} to {{Connection#closeAsync}} in [JAVA-966]. We should check in the triggerOn* methods like we do in the on* methods to see if the cluster is closed/closing before submitting to the executor. In theory there still might be a very thin window where the executor is shutdown between a condition check and submitting the Task.
    via by Andy Tolbert,
  • notebook throws errors that the shell doesn't
    via by Marcin Jurek,
    • java.util.concurrent.RejectedExecutionException: Task com.google.common.util.concurrent.ListenableFutureTask@44d138e5 rejected from java.util.concurrent.ThreadPoolExecutor@3ee65af[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 3] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) at com.google.common.util.concurrent.MoreExecutors$ListeningDecorator.execute(MoreExecutors.java:480) at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:49) at com.datastax.driver.core.Cluster$Manager.triggerOnDown(Cluster.java:1726) at com.datastax.driver.core.Cluster$Manager.signalConnectionFailure(Cluster.java:2037) at com.datastax.driver.core.Connection.closeAsync(Connection.java:619) at com.datastax.driver.core.HostConnectionPool.discardAvailableConnections(HostConnectionPool.java:628) at com.datastax.driver.core.HostConnectionPool.closeAsync(HostConnectionPool.java:606) at com.datastax.driver.core.SessionManager.closeAsync(SessionManager.java:160) at com.datastax.driver.core.Cluster$Manager.close(Cluster.java:1576) at com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:1261) at com.datastax.driver.core.Cluster.closeAsync(Cluster.java:552) at com.datastax.driver.core.Cluster.close(Cluster.java:563) at com.datastax.driver.core.policies.DCAwareRoundRobinPolicyTest.should_not_use_remote_hosts_if_some_nodes_are_up_in_local_dc(DCAwareRoundRobinPolicyTest.java:149)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    92 more bugmates