You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2017/05/11 11:05:04 UTC
qpid-broker-j git commit: QPID-7753: Avoid possibility of
RejectedExecutionException during shutdown
Repository: qpid-broker-j
Updated Branches:
refs/heads/master 074ccdd81 -> 17ce2e384
QPID-7753: Avoid possibility of RejectedExecutionException during shutdown
Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/17ce2e38
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/17ce2e38
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/17ce2e38
Branch: refs/heads/master
Commit: 17ce2e38430fc8a45e9b3d135f0d304115da944e
Parents: 074ccdd
Author: Keith Wall <kw...@apache.org>
Authored: Thu May 11 12:02:21 2017 +0100
Committer: Keith Wall <kw...@apache.org>
Committed: Thu May 11 12:02:21 2017 +0100
----------------------------------------------------------------------
.../server/virtualhost/AbstractVirtualHost.java | 38 +++++++++++++-------
1 file changed, 25 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/17ce2e38/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java b/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
index 3e271d9..7c3ac37 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
@@ -55,6 +55,7 @@ import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
+import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@@ -1404,19 +1405,30 @@ public abstract class AbstractVirtualHost<X extends AbstractVirtualHost<X>> exte
@Override
public ListenableFuture<Void> reallocateMessages()
{
- final Future future = _houseKeepingTaskExecutor.submit(() ->
- {
- final Collection<Queue> queues =
- getChildren(Queue.class);
- for (Queue q : queues)
- {
- if (q.getState() == State.ACTIVE)
- {
- q.reallocateMessages();
- }
- }
- });
- return JdkFutureAdapters.listenInPoolThread(future);
+ final Future future;
+ try
+ {
+ future = _houseKeepingTaskExecutor.submit(() ->
+ {
+ final Collection<Queue> queues = getChildren(Queue.class);
+ for (Queue q : queues)
+ {
+ if (q.getState() == State.ACTIVE)
+ {
+ q.reallocateMessages();
+ }
+ }
+ });
+ return JdkFutureAdapters.listenInPoolThread(future);
+ }
+ catch (RejectedExecutionException e)
+ {
+ if (!_houseKeepingTaskExecutor.isShutdown())
+ {
+ _logger.warn("Failed to schedule reallocation of messages", e);
+ }
+ return Futures.immediateFuture(null);
+ }
}
@Override
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org