Repository: activemq-artemis
Updated Branches:
refs/heads/master 66edcf7f6 -> 341ecd4d1
ARTEMIS-1441 Critical Analyzer Check Period not properly parsed
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/796c4f2c
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/796c4f2c
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/796c4f2c
Branch: refs/heads/master
Commit: 796c4f2c4ea5f5216f6f0670abc5a1b62f007f3a
Parents: 66edcf7
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Sep 27 20:54:53 2017 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Sep 27 20:59:05 2017 -0400
----------------------------------------------------------------------
.../utils/critical/CriticalAnalyzerImpl.java | 3 ++-
.../core/server/impl/ActiveMQServerImpl.java | 17 +++++++++--------
2 files changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/796c4f2c/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerImpl.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerImpl.java
index ef31fe8..55c1854 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerImpl.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerImpl.java
@@ -64,7 +64,7 @@ public class CriticalAnalyzerImpl implements CriticalAnalyzer {
@Override
public CriticalAnalyzer setCheckTime(long timeout, TimeUnit unit) {
- this.checkTimeNanoSeconds = timeout;
+ this.checkTimeNanoSeconds = unit.toNanos(timeout);
return this;
}
@@ -147,6 +147,7 @@ public class CriticalAnalyzerImpl implements CriticalAnalyzer {
// this means that the server has been stopped as we could acquire the semaphore... returning now
break;
}
+ logger.trace("Checking critical analyzer");
check();
}
} catch (InterruptedException interrupted) {
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/796c4f2c/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 8dec6a4..0663efe 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -322,8 +322,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
private final ActiveMQServer parentServer;
-
- private final CriticalAnalyzer analyzer;
+ private CriticalAnalyzer analyzer;
//todo think about moving this to the activation
private final List<SimpleString> scaledDownNodeIDs = new ArrayList<>();
@@ -435,12 +434,6 @@ public class ActiveMQServerImpl implements ActiveMQServer {
this.parentServer = parentServer;
this.serviceRegistry = serviceRegistry == null ? new ServiceRegistryImpl() : serviceRegistry;
-
- if (configuration.isCriticalAnalyzer()) {
- this.analyzer = new CriticalAnalyzerImpl();
- } else {
- this.analyzer = EmptyCriticalAnalyzer.getInstance();
- }
}
@Override
@@ -573,6 +566,14 @@ public class ActiveMQServerImpl implements ActiveMQServer {
}
private void initializeCriticalAnalyzer() throws Exception {
+ if (analyzer == null) {
+ if (configuration.isCriticalAnalyzer()) {
+ this.analyzer = new CriticalAnalyzerImpl();
+ } else {
+ this.analyzer = EmptyCriticalAnalyzer.getInstance();
+ }
+ }
+
/** Calling this for cases where the server was stopped and now is being restarted... failback, etc...*/
this.analyzer.clear();
This closes #1559 Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/341ecd4d Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/341ecd4d Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/341ecd4d Branch: refs/heads/master Commit: 341ecd4d1a3d7172c7f6d36c19b56dd75c3b1cac Parents: 66edcf7 796c4f2 Author: Justin Bertram <jb...@apache.org> Authored: Thu Sep 28 13:42:06 2017 -0500 Committer: Justin Bertram <jb...@apache.org> Committed: Thu Sep 28 13:42:06 2017 -0500 ---------------------------------------------------------------------- .../utils/critical/CriticalAnalyzerImpl.java | 3 ++- .../core/server/impl/ActiveMQServerImpl.java | 17 +++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) ----------------------------------------------------------------------