You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2014/12/31 14:56:44 UTC

[1/3] incubator-nifi git commit: NIFI-215: Shut down the ProcessScheduler that is used for Reporting Tasks when NCM is stopped

Repository: incubator-nifi
Updated Branches:
  refs/heads/develop a183d88f2 -> ebf3cdc77


NIFI-215: Shut down the ProcessScheduler that is used for Reporting Tasks when NCM is stopped


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

Branch: refs/heads/develop
Commit: d879e0d640a1bc6c4de2ea3a4ad2666a00b18e29
Parents: a183d88
Author: Mark Payne <ma...@hotmail.com>
Authored: Wed Dec 31 08:07:40 2014 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Wed Dec 31 08:07:40 2014 -0500

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


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/d879e0d6/nar-bundles/framework-bundle/framework/cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java b/nar-bundles/framework-bundle/framework/cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
index 3defea7..511bb7d 100644
--- a/nar-bundles/framework-bundle/framework/cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
+++ b/nar-bundles/framework-bundle/framework/cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
@@ -512,6 +512,10 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
                 servicesBroadcaster.stop();
             }
 
+            if ( processScheduler != null ) {
+                processScheduler.shutdown();
+            }
+            
             if (encounteredException) {
                 throw new IOException("Failed to shutdown Cluster Manager because one or more cluster services failed to shutdown.  Check the logs for details.");
             }


[3/3] incubator-nifi git commit: NIFI-215: Make the 'detect timing issues' task a daemon

Posted by ma...@apache.org.
NIFI-215: Make the 'detect timing issues' task a daemon


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

Branch: refs/heads/develop
Commit: ebf3cdc7795a4cfab2ec7bd41f1b25e0b246ca7a
Parents: 0297fa4
Author: Mark Payne <ma...@hotmail.com>
Authored: Wed Dec 31 08:45:25 2014 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Wed Dec 31 08:45:25 2014 -0500

----------------------------------------------------------------------
 .../runtime/src/main/java/org/apache/nifi/NiFi.java  | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/ebf3cdc7/nar-bundles/framework-bundle/framework/runtime/src/main/java/org/apache/nifi/NiFi.java
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/runtime/src/main/java/org/apache/nifi/NiFi.java b/nar-bundles/framework-bundle/framework/runtime/src/main/java/org/apache/nifi/NiFi.java
index 98489af..ed7c329 100644
--- a/nar-bundles/framework-bundle/framework/runtime/src/main/java/org/apache/nifi/NiFi.java
+++ b/nar-bundles/framework-bundle/framework/runtime/src/main/java/org/apache/nifi/NiFi.java
@@ -26,6 +26,7 @@ import java.util.TimerTask;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
@@ -160,7 +161,19 @@ public class NiFi {
         final int minRequiredOccurrences = 25;
         final int maxOccurrencesOutOfRange = 15;
         final AtomicLong lastTriggerMillis = new AtomicLong(System.currentTimeMillis());
-        final ScheduledExecutorService service = Executors.newScheduledThreadPool(1);
+        
+        final ScheduledExecutorService service = Executors.newScheduledThreadPool(1, new ThreadFactory() {
+            private final ThreadFactory defaultFactory = Executors.defaultThreadFactory();
+            
+            @Override
+            public Thread newThread(final Runnable r) {
+                final Thread t = defaultFactory.newThread(r);
+                t.setDaemon(true);
+                t.setName("Detect Timing Issues");
+                return t;
+            }
+        });
+        
         final AtomicInteger occurrencesOutOfRange = new AtomicInteger(0);
         final AtomicInteger occurences = new AtomicInteger(0);
         final Runnable command = new Runnable() {


[2/3] incubator-nifi git commit: NIFI-215: Look for the pid in the output of the ps command and do not use the --no-headers argument because it's not compatible with OSX

Posted by ma...@apache.org.
NIFI-215: Look for the pid in the output of the ps command and do not use the --no-headers argument because it's not compatible with OSX


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

Branch: refs/heads/develop
Commit: 0297fa465f230028ca83f8a4d573de185fe79f5f
Parents: d879e0d
Author: Mark Payne <ma...@hotmail.com>
Authored: Wed Dec 31 08:24:44 2014 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Wed Dec 31 08:24:44 2014 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/nifi/bootstrap/RunNiFi.java | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0297fa46/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java
----------------------------------------------------------------------
diff --git a/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java b/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java
index 0f97f2d..e8f6439 100644
--- a/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java
+++ b/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java
@@ -294,25 +294,24 @@ public class RunNiFi {
 	        // We use the "ps" command to check if the process is still running.
 	        final ProcessBuilder builder = new ProcessBuilder();
 	        
-	        builder.command("ps", "-p", pid, "--no-headers");
+	        builder.command("ps", "-p", pid);
 	        final Process proc = builder.start();
 	        
-	        // Read how many lines are output by the 'ps' command
-	        int lineCount = 0;
+	        // Look for the pid in the output of the 'ps' command.
+	        boolean running = false;
 	        String line;
 	        try (final InputStream in = proc.getInputStream();
 	             final Reader streamReader = new InputStreamReader(in);
 	             final BufferedReader reader = new BufferedReader(streamReader)) {
 	            
 	            while ((line = reader.readLine()) != null) {
-	                if ( !line.trim().isEmpty() ) {
-	                    lineCount++;
-	                }
+                    if ( line.trim().startsWith(pid) ) {
+                        running = true;
+                    }
 	            }
 	        }
 	        
-	        // If anything was output, the process is running.
-	        final boolean running = lineCount > 0;
+	        // If output of the ps command had our PID, the process is running.
 	        if ( running ) {
 	            logger.fine("Process with PID " + pid + " is running");
 	        } else {