Github user Ben-Zvi commented on a diff in the pull request:
https://github.com/apache/drill/pull/1239#discussion_r183607110
--- Diff: distribution/src/resources/yarn-drillbit.sh ---
@@ -110,6 +114,36 @@
# Enables Java GC logging. Passed from the drill.yarn.drillbit.log-gc
# garbage collection option.
+### Function to enforce CGroup (Refer local drillbit.sh)
+check_and_enforce_cgroup(){
+ dbitPid=$1;
+ kill -0 $dbitPid
+ if [ $? -gt 0 ]; then
+ echo "ERROR: Failed to add Drillbit to CGroup ( $DRILLBIT_CGROUP )
for 'cpu'. Ensure that the Drillbit ( pid=$dbitPid ) started up." >&2
+ exit 1
+ fi
+ SYS_CGROUP_DIR=${SYS_CGROUP_DIR:-"/sys/fs/cgroup"}
+ if [ -f $SYS_CGROUP_DIR/cpu/$DRILLBIT_CGROUP/cgroup.procs ]; then
+ echo $dbitPid > $SYS_CGROUP_DIR/cpu/$DRILLBIT_CGROUP/cgroup.procs
+ # Verify Enforcement
+ cgroupStatus=`grep -w $pid
$SYS_CGROUP_DIR/cpu/${DRILLBIT_CGROUP}/cgroup.procs`
+ if [ -z "$cgroupStatus" ]; then
--- End diff --
I'm confused: Is this checking for $dbitPid (in cgroup.procs) or for $pid ?
In case the former, then need to negate the following "-z" condition.
---