Author: cwiklik
Date: Mon Dec 12 17:22:02 2016
New Revision: 1773834

URL: http://svn.apache.org/viewvc?rev=1773834&view=rev
Log:
UIMA-5210 process is not rogue if its owner is the same as a user who started 
an agent

Modified:
    
uima/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeUsersCollector.java

Modified: 
uima/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeUsersCollector.java
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeUsersCollector.java?rev=1773834&r1=1773833&r2=1773834&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeUsersCollector.java
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeUsersCollector.java
 Mon Dec 12 17:22:02 2016
@@ -49,6 +49,7 @@ public class NodeUsersCollector implemen
   DuccLogger logger;
   Agent agent;
   int gidMax = 500;
+  static String ducc_user = System.getProperty("user.name");
   
   public NodeUsersCollector(Agent agent, DuccLogger logger) {
     this.agent = agent;
@@ -195,7 +196,7 @@ public class NodeUsersCollector implemen
   private boolean processAncestorIsOwnedByDucc(String ppid, 
Set<RunningProcess> list) {
          for( RunningProcess pi : list ) {
                  if ( pi.getPid().equals(ppid) ) {
-                         if (  pi.getOwner().equalsIgnoreCase("ducc") ) {
+                         if (  pi.getOwner().equalsIgnoreCase(ducc_user) ) {
                                  return true;
                          } else {
                                  return 
processAncestorIsOwnedByDucc(pi.getPpid(), list);
@@ -295,10 +296,14 @@ public class NodeUsersCollector implemen
             if ( processAncestorIsOwnedByDucc(pid, tempProcessList)) {
                continue;  // skip as this is not a rogue process
             }
+            // any process owned by user who started the agent process is not 
rogue
+            if ( ducc_user.equalsIgnoreCase(user)) {
+               continue;
+            }
                // Detect and skip all ducc daemons except uima-as service
-          if ( duccDaemon(tokens)) {
-            continue;
-          }
+//          if ( duccDaemon(tokens)) {
+//            continue;
+//          }
           if ( logger == null ) {
             //System.out.print(line);
           } else {


Reply via email to