[
https://issues.apache.org/jira/browse/DRILL-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16465258#comment-16465258
]
ASF GitHub Bot commented on DRILL-143:
--------------------------------------
asfgit closed pull request #1239: DRILL-143: CGroup Support for Drill-on-YARN
URL: https://github.com/apache/drill/pull/1239
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/distribution/src/resources/drillbit.sh
b/distribution/src/resources/drillbit.sh
index 7dad34cf50..88d56c8a14 100755
--- a/distribution/src/resources/drillbit.sh
+++ b/distribution/src/resources/drillbit.sh
@@ -119,9 +119,9 @@ check_before_start()
{
#check that the process is not running
mkdir -p "$DRILL_PID_DIR"
- if [ -f $pid ]; then
- if kill -0 `cat $pid` > /dev/null 2>&1; then
- echo "$command is already running as process `cat $pid`. Stop it first."
+ if [ -f $pidFile ]; then
+ if kill -0 `cat $pidFile` > /dev/null 2>&1; then
+ echo "$command is already running as process `cat $pidFile`. Stop it
first."
exit 1
fi
fi
@@ -146,8 +146,8 @@ check_and_enforce_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
+ cgroupStatus=`grep -w $dbitPid
$SYS_CGROUP_DIR/cpu/${DRILLBIT_CGROUP}/cgroup.procs`
+ if [ -n "$cgroupStatus" ]; then
#Ref: https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt
cpu_quota=`cat
${SYS_CGROUP_DIR}/cpu/${DRILLBIT_CGROUP}/cpu.cfs_quota_us`
cpu_period=`cat
${SYS_CGROUP_DIR}/cpu/${DRILLBIT_CGROUP}/cpu.cfs_period_us`
@@ -189,8 +189,8 @@ start_bit ( )
echo "`ulimit -a`" >> "$DRILLBIT_LOG_PATH" 2>&1
nohup nice -n $DRILL_NICENESS "$DRILL_HOME/bin/runbit" exec ${args[@]} >>
"$logout" 2>&1 &
procId=$!
- echo $procId > $pid # Yeah, $pid is a file, $procId is the pid...
- echo $! > $pid
+ echo $procId > $pidFile # Yeah, $pidFile is a file, $procId is the pid...
+ echo $! > $pidFile
sleep 1
check_after_start $procId
}
@@ -198,8 +198,8 @@ start_bit ( )
stop_bit ( )
{
kill_drillbit=$1
- if [ -f $pid ]; then
- pidToKill=`cat $pid`
+ if [ -f $pidFile ]; then
+ pidToKill=`cat $pidFile`
# kill -0 == see if the PID exists
if kill -0 $pidToKill > /dev/null 2>&1; then
echo "Stopping $command"
@@ -211,15 +211,15 @@ stop_bit ( )
retval=$?
echo "No $command to stop because kill -0 of pid $pidToKill failed with
status $retval"
fi
- rm $pid > /dev/null 2>&1
+ rm $pidFile > /dev/null 2>&1
else
- echo "No $command to stop because no pid file $pid"
+ echo "No $command to stop because no pid file $pidFile"
retval=1
fi
return $retval
}
-pid=$DRILL_PID_DIR/drillbit.pid
+pidFile=$DRILL_PID_DIR/drillbit.pid
logout="${DRILL_LOG_PREFIX}.out"
thiscmd=$0
@@ -271,12 +271,12 @@ case $startStopStatus in
;;
(status)
- if [ -f $pid ]; then
- TARGET_PID=`cat $pid`
+ if [ -f $pidFile ]; then
+ TARGET_PID=`cat $pidFile`
if kill -0 $TARGET_PID > /dev/null 2>&1; then
echo "$command is running."
else
- echo "$pid file is present but $command is not running."
+ echo "$pidFile file is present but $command is not running."
exit 1
fi
else
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Support CGROUPs resource management
> -----------------------------------
>
> Key: DRILL-143
> URL: https://issues.apache.org/jira/browse/DRILL-143
> Project: Apache Drill
> Issue Type: New Feature
> Reporter: Jacques Nadeau
> Assignee: Kunal Khatua
> Priority: Major
> Labels: doc-impacting, ready-to-commit
> Fix For: 1.14.0
>
> Attachments: 253ce178-ddeb-e482-cd64-44ab7284ad1c.sys.drill
>
>
> For the purpose of playing nice on clusters that don't have YARN, we should
> write up configuration and scripts to allows users to run Drill next to
> existing workloads without sharing resources.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)