Bug 1321061 - [RFE] Provide an easy way to kill all child processes (in Cleanup phase)
Summary: [RFE] Provide an easy way to kill all child processes (in Cleanup phase)
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: Dalibor Pospíšil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-24 15:07 UTC by Peter Hostačný
Modified: 2018-01-29 23:55 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)

Description Peter Hostačný 2016-03-24 15:07:45 UTC
Description of problem:
It would be fine, if beakerlib provides some function to kill all child processes. Remembering all PIDs and then killing them is not very elegant. Even pkill utility is not very good solution, sometimes it may be a bit drastic.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. 
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Dalibor Pospíšil 2016-03-24 15:30:44 UTC
I used to do something like this using pgrep -P and recursive go through the tree of children and then sending signal to all the processes. This might be an option. I do not know it if is sufficiently powerful, though.

Anyway it is questionable if such function should be in core beakerlib.

Now wait for other maintainers to express themselves.

Comment 2 Ales Zelinka 2016-03-24 16:49:34 UTC
is this aimed at preventing the task from getting stuck at the very end and then getting killed by watchdog? If yes then ack+

Comment 3 Dalibor Pospíšil 2016-04-07 12:37:38 UTC
I am not sure how running processes left on the machine would cause watchdog come to play. Anyway I can imagine I would like to kill everything I executed on background but I never touched that as I kill exactly what I have executed using library(distribution/Cleanup).

Can you provide us with some real/life examples?

Comment 4 Peter Hostačný 2016-04-14 08:25:44 UTC
I was looking into some issue with python test.
Test was passing on clean machine but failing if you run it for second, third... time. That was nice use-case for test-inspector, but TI only detected few created/changed files that didn't cause this behavior (backuping them and restoring in cleanup phase didn'ŧ solve this problem).
Problem was in running processes (openssl running in background), that TI cannot catch. jprokes helped me find out what caused this problem in 1MT, because it was passing there after using retest option, but failing after repeated manual runs (1MT probably reset ssh session if you do retest by 1MT option).

Problem was solved by using "pkill openssl" in cleanup phase, but pkill should be sometimes a little bit drastic, because it is killing all processes with matched name ... so something like "kill all my child" feature would help to solve this issue in more elegantly way.

http://pkgs.devel.redhat.com/cgit/tests/python/diff/Regression/bz1219108-python-backport-PEP-476-with-global-toggle-to/runtest.sh?id=ee0a7de55d08949f201fc05600f4d7f865b12136


Note You need to log in before you can comment on or make changes to this bug.