Author: cwiklik
Date: Thu Apr 21 20:19:44 2016
New Revision: 1740402
URL: http://svn.apache.org/viewvc?rev=1740402&view=rev
Log:
UIMA-4907 check if process is in any of the cgroups containers while detecting
rogues
Modified:
uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/NodeAgent.java
Modified:
uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/NodeAgent.java
URL:
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/NodeAgent.java?rev=1740402&r1=1740401&r2=1740402&view=diff
==============================================================================
---
uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/NodeAgent.java
(original)
+++
uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/NodeAgent.java
Thu Apr 21 20:19:44 2016
@@ -1488,6 +1488,13 @@ public class NodeAgent extends AbstractD
NodeUsersCollector.ProcessInfo cpi) throws Exception {
synchronized (monitor) {
+ // if cgroups are enabled, check if a given PID (cpi) exists in any of
+ // the containers. If so, the process is not rogue.
+ if ( useCgroups ) {
+ if ( cgroupsManager.isPidInCGroup(String.valueOf(cpi.getPid()))
) {
+ return false;
+ }
+ }
// Agent adds a process to its inventory before launching it. So it
// is
// possible that the inventory contains a process with no PID. If