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/12/13 16:35:06 UTC
svn commit: r1774046 - in /uima/uima-ducc/trunk:
src/main/resources/default.ducc.properties
uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeUsersCollector.java
Author: cwiklik
Date: Tue Dec 13 16:35:06 2016
New Revision: 1774046
URL: http://svn.apache.org/viewvc?rev=1774046&view=rev
Log:
UIMA-5213 deprecated ducc.agent.node.metrics.sys.gid.max and added ducc.agent.node.metrics.sys.uid.max
Modified:
uima/uima-ducc/trunk/src/main/resources/default.ducc.properties
uima/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeUsersCollector.java
Modified: uima/uima-ducc/trunk/src/main/resources/default.ducc.properties
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/src/main/resources/default.ducc.properties?rev=1774046&r1=1774045&r2=1774046&view=diff
==============================================================================
--- uima/uima-ducc/trunk/src/main/resources/default.ducc.properties (original)
+++ uima/uima-ducc/trunk/src/main/resources/default.ducc.properties Tue Dec 13 16:35:06 2016
@@ -756,7 +756,7 @@ ducc.agent.managed.process.state.update.
# Max UID reserved by OS. This is used to detect rogue processes and to report
# available memory on a node.
-ducc.agent.node.metrics.sys.gid.max=500
+ducc.agent.node.metrics.sys.uid.max=500
# The interval in milliseconds between node metric publications.
# Every agent publishes its updates at this rate. On large clusters, a high rate (small
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=1774046&r1=1774045&r2=1774046&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 Tue Dec 13 16:35:06 2016
@@ -48,22 +48,38 @@ public class NodeUsersCollector implemen
DuccLogger logger;
Agent agent;
+
+
+ // gidMax is deprecated. New code should use uidMad. 12/13/2016
int gidMax = 500;
+ // the gidMax should have been uidMax. Continue using both for the time being
+ // Processes owned by user id <= max user id are considered "system" and excluded from rogue
+ // process detection.
+ int uidMax = 500; // default
+
+
static String ducc_user = System.getProperty("user.name");
public NodeUsersCollector(Agent agent, DuccLogger logger) {
this.agent = agent;
this.logger = logger;
String tmp;
- // SYSTEM_GID_MAX
- if ((tmp = System
+ // gidMax and uidMax mean the same thing. The gidMax is deprecated. New code should
+ // use uidMax.
+ if ((tmp = System
.getProperty("ducc.agent.node.metrics.sys.gid.max")) != null) {
- try {
- gidMax = Integer.valueOf(tmp);
- } catch (NumberFormatException e) {
- e.printStackTrace();
+ if ( Utils.isNumber(tmp) ) {
+ uidMax = Integer.valueOf(tmp); // use uidMax
}
}
+ // in case both properties are set ...gid.max and ...uid.max, the latter wins
+ if ((tmp = System
+ .getProperty("ducc.agent.node.metrics.sys.uid.max")) != null) {
+ if ( Utils.isNumber(tmp) ) {
+ uidMax = Integer.valueOf(tmp);
+ }
+ }
+
}
/**
* Returns true if a given userId belongs to an exclusion list defined in ducc.properties.
@@ -285,7 +301,7 @@ public class NodeUsersCollector implemen
if ( tokens.length > 0 ) {
try {
// by convention processes owned by uid < gidMax are system processes thus not rogue
- if ( Integer.valueOf(uid) < gidMax ) {
+ if ( Integer.valueOf(uid) < uidMax ) {
continue;
}
} catch( NumberFormatException nfe) {