You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mo...@apache.org on 2015/11/04 18:20:07 UTC

nifi git commit: NIFI-1085 WebClusterManager fair locking and HeartbeatMonitoringTimerTask scheduling

Repository: nifi
Updated Branches:
  refs/heads/NIFI-1085 [created] 6add372bc


NIFI-1085 WebClusterManager fair locking and HeartbeatMonitoringTimerTask scheduling


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/6add372b
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/6add372b
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/6add372b

Branch: refs/heads/NIFI-1085
Commit: 6add372bc142304ef25e0bafb49709654a995f08
Parents: 201eac0
Author: Mike Moser <mo...@apache.org>
Authored: Wed Nov 4 12:14:46 2015 -0500
Committer: Mike Moser <mo...@apache.org>
Committed: Wed Nov 4 12:19:00 2015 -0500

----------------------------------------------------------------------
 .../org/apache/nifi/cluster/manager/impl/WebClusterManager.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/6add372b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
index 8d246c1..c22e1ec 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
@@ -330,7 +330,7 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
     private final OptimisticLockingManager optimisticLockingManager;
     private final StringEncryptor encryptor;
     private final Queue<Heartbeat> pendingHeartbeats = new ConcurrentLinkedQueue<>();
-    private final ReentrantReadWriteLock resourceRWLock = new ReentrantReadWriteLock();
+    private final ReentrantReadWriteLock resourceRWLock = new ReentrantReadWriteLock(true);
     private final ClusterManagerLock readLock = new ClusterManagerLock(resourceRWLock.readLock(), "Read");
     private final ClusterManagerLock writeLock = new ClusterManagerLock(resourceRWLock.writeLock(), "Write");
 
@@ -480,7 +480,7 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
             try {
                 // setup heartbeat monitoring
                 heartbeatMonitor = new Timer("Heartbeat Monitor", /* is daemon */ true);
-                heartbeatMonitor.scheduleAtFixedRate(new HeartbeatMonitoringTimerTask(), 0, getHeartbeatMonitoringIntervalSeconds() * 1000);
+                heartbeatMonitor.schedule(new HeartbeatMonitoringTimerTask(), 0, getHeartbeatMonitoringIntervalSeconds() * 1000);
 
                 heartbeatProcessor = new Timer("Process Pending Heartbeats", true);
                 final int processPendingHeartbeatDelay = 1000 * Math.max(1, getClusterProtocolHeartbeatSeconds() / 2);