osmo-gsm-tester[report]: Free resources and kill subprocesses when signal to stop is ...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Wed May 17 15:14:39 UTC 2017


Patch Set 1:

(4 comments)

https://gerrit.osmocom.org/#/c/2670/1//COMMIT_MSG
Commit Message:

Line 7: Free resources and kill subprocesses when signal to stop is received
> "handle Ctrl+C and other signals gracefully" ?
Self record for later:
- I see the issue for instance when sending a SIGINT or SIGTERM with kill to the osmo-gsm-tester process. The process is killed but the state dir is not cleaned and the subprocesses launched by the suite_run are not killed. This of course happen if you kill it while already inside the test suite with all the subprocesses created.

- I initially saw this because I'm running the osmo_gsm_tester over ssh. Now running it with "ssh -t" helps forwarding the signal correctly but I still need this patches to make it more robust and always have a clean state.


https://gerrit.osmocom.org/#/c/2670/1/src/osmo_gsm_tester/suite.py
File src/osmo_gsm_tester/suite.py:

Line 299:         # if sys.exit() called from SIGTINT handler, SystemExit base exception
> SIGINT ... or rather "signal handler" since you're handling various signals
Agree


Line 301:         # section:
> (let's have this comment in the finally section)
Agree


Line 313:         finally:
> possibly this "finally:" is the only required change?
what do you mind? can I have a "finally:" clause without a "try:" ?

I swapped the SuiteRun.Results(self) line with the reserve_resources() one to avoid race conditions in which the SIGINT is sent and "results" is not initialized.

Not sure if reserve_resources() can be outside of the try, but it's not harming it to be there and stop processes in case it did start any.


-- 
To view, visit https://gerrit.osmocom.org/2670
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I039e4d1908a04bf606b101ddc6a186ba67e6178e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: report
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-HasComments: Yes



More information about the gerrit-log mailing list