box / box/ClusterRunner

When clusterrunner service dies, child processes should also die

Open
#179 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
184
Forks
41
PR merge metrics
No merged PRs in 30d

Description

David Duke noticed that an orphaned PHPUnit process (spawned by a previous deployment of clusterrunner) was stuck and still running from the day before. We need to change the way we execute commands on the slave service so that orphaned processes just die.

bash-4.1$ ps aux | grep PHPUNIT_THREAD
jenkins 2554 0.0 0.0 103240 896 pts/0 S+ 15:23 0:00 grep PHPUNIT_THREAD
jenkins 16407 0.0 0.0 9196 1236 ? Ss 13:51 0:00 /bin/sh -c export BUILD_EXECUTOR_INDEX="82"; export ARTIFACT_DIR="/home/jenkins/.clusterrunner/artifacts/546/artifact_189_0"; export EXECUTOR_INDEX="2"; export MACHINE_EXECUTOR_INDEX="2"; export ATOM_ID="0"; export PROJECT_DIR="/tmp/clusterrunner_build_symlinks/9c9033b5-c8ae-458f-858e-d6bad98a347d"; export TESTPATH="/tmp/clusterrunner_build_symlinks/9c9033b5-c8ae-458f-858e-d6bad98a347d/test/php/integration/modular/email/email-ui/legacy/lib/Email_Sender_Test.php"; cd $PROJECT_DIR && for i in 1 2; do PHPUNIT_THREAD_INDEX=$EXECUTOR_INDEX $PROJECT_DIR/phpunit --log-junit $ARTIFACT_DIR/result.xml $TESTPATH && break; done && test -f $ARTIFACT_DIR/result.xml && xmllint --noout $ARTIFACT_DIR/result.xml
jenkins 17764 0.0 0.0 9196 1232 ? Ss Jun15 0:00 /bin/sh -c export EXECUTOR_INDEX="2"; export MACHINE_EXECUTOR_INDEX="2"; export ATOM_ID="1"; export BUILD_EXECUTOR_INDEX="92"; export ARTIFACT_DIR="/home/jenkins/.clusterrunner/artifacts/567/artifact_185_1"; export PROJECT_DIR="/tmp/clusterrunner_build_symlinks/317efc10-9ad4-47d5-83ca-4c5f9489df42"; export TESTPATH="/tmp/clusterrunner_build_symlinks/317efc10-9ad4-47d5-83ca-4c5f9489df42/test/php/integration/modular/enterprise-user-management/enterprise-groups/legacy/subscribers/BoxEventsGroupTagUserDestroySubscriberTest.php"; cd $PROJECT_DIR && for i in 1 2; do PHPUNIT_THREAD_INDEX=$EXECUTOR_INDEX $PROJECT_DIR/phpunit --log-junit $ARTIFACT_DIR/result.xml $TESTPATH && break; done && test -f $ARTIFACT_DIR/result.xml && xmllint --noout $ARTIFACT_DIR/result.xml
bash-4.1$ ps -p 17764 -o ppid=
1
bash-4.1$

http://stackoverflow.com/questions/26314487/python-avoid-orphan-processes

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect the slave service's command-execution entry point and the process-parent behavior shown in the issue; use the linked Stack Overflow discussion as background. Done means child PHPUnit processes do not remain orphaned after ClusterRunner exits.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, python
Domain
backend, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.