But the caller has already multiplied precision_range by
TIME_UNITS_PER_SECOND, so they are passing in whole seconds' worth of
jiffies! I can't see any reason why they should be doing that. And if
that was really what was intended, why not just pass in seconds in the
first place?
If that's the logic error, then the fix is simple:
--- src/condor_procapi/procapi.cpp.orig 2015-04-07
16:10:11.000000000 +0100
+++ src/condor_procapi/procapi.cpp 2015-07-07 14:07:20.583286037 +0100
@@ -3276,10 +3276,6 @@
precision_range = &DEFAULT_PRECISION_RANGE;
}
- // convert to the same time units as the rest of
- // the process id
- *precision_range = (int)ceil( ((double)*precision_range) *
TIME_UNITS_PER_SEC);
-
/* Initialize the Process Id
This WILL ALWAYS create memory the caller is responsible for.
*/
This reduces the sleep time to the minimum 1 second[^3], and has the
nice side-effect of also fixing another bug described in [^2] below.