You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2016/09/01 14:30:45 UTC

svn commit: r1758783 - /uima/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/NodeAgent.java

Author: cwiklik
Date: Thu Sep  1 14:30:45 2016
New Revision: 1758783

URL: http://svn.apache.org/viewvc?rev=1758783&view=rev
Log:
UIMA-5098 dont try to cleanup cgroups if cgroup creation fails on agent startup

Modified:
    uima/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/NodeAgent.java

Modified: uima/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/NodeAgent.java
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/NodeAgent.java?rev=1758783&r1=1758782&r2=1758783&view=diff
==============================================================================
--- uima/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/NodeAgent.java (original)
+++ uima/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/NodeAgent.java Thu Sep  1 14:30:45 2016
@@ -329,14 +329,20 @@ public class NodeAgent extends AbstractD
                 	  cgroupFailureReason = ee.getMessage();
                 	  useCgroups = false;
                   }
-
-                  try {
-                      // remove stale CGroups
-                      cgroupsManager.cleanupOnStartup();
-                    } catch (Exception e) {
-                      logger.error("nodeAgent", null, e);
-
-                    }
+                  if ( useCgroups ) {
+                      try {
+                          // remove stale CGroups
+                          cgroupsManager.cleanupOnStartup();
+                        } catch (Exception e) {
+                          logger.error("nodeAgent", null, e);
+                    	  useCgroups = false;
+                          logger.info("nodeAgent",null,"Agent cgroup cleanup failed on this machine base directory in "+cgroupsBaseDir+". Check if cgroups is installed on this node, Agent has correct permissions (consistent with cgconfig.conf), and the cgroup daemon is running");
+                          cgroupFailureReason = "------- CGroups Not Working on this Machine";
+                        }
+                  } else {
+                      logger.info("nodeAgent",null,"Agent cgroup test failed on this machine base directory in "+cgroupsBaseDir+". Check if cgroups is installed on this node, Agent has correct permissions (consistent with cgconfig.conf), and the cgroup daemon is running");
+                      cgroupFailureReason = "------- CGroups Not Working on this Machine";
+                  }
 
                 } else {
                   logger.info("nodeAgent",null,"Agent failed to find cgroup base directory in "+cgroupsBaseDir+". Check if cgroups is installed on this node and the cgroup daemon is running");