summaryrefslogtreecommitdiff
path: root/buildstream/_signals.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove shebangs from python filesremove_shebangsGökçen Nurlu2018-06-181-1/+0
| | | | Fixes #424
* pylint - dealt with redefined-outer-name and redefined-built in warningsJames Ennis2018-03-141-4/+4
|
* pylint - dealt with global-statement warningJames Ennis2018-03-141-2/+2
|
* pylint - dealt with broad-except and bare-except warningsJames Ennis2018-03-141-1/+1
|
* _signals.terminator_handler: wrap handlers in trysAngelos Evripiotis2017-12-221-1/+14
| | | | | | | | It's possible for the custom termination handlers to raise exceptions. Indeed this was actually the case for utils._call(). They're especially difficult to reach with tests, so make extra effort to insulate them. Print any exceptions encountered as a regular traceback before exiting.
* _signals: always pop handlers, and restore statesAngelos Evripiotis2017-12-131-19/+23
|
* _signals: note os._exit() on terminateAngelos Evripiotis2017-12-131-0/+4
| | | | | Make it explicit that we should not rely on 'finally' clauses to clean up for us in the event of termination.
* _signals.py: Cleaning up blocked() context manager and adding ignored()Tristan Van Berkom2017-06-251-20/+33
| | | | | | Break these two functionalities into separate context managers. The blocked() context manager now just uses the ignored() context manager when also ignoring.
* _signals.py: Added blocked() context managerTristan Van Berkom2017-05-301-0/+39
| | | | | | | A simpler context manager for ignoring signals in a code block, also takes a "discard" option to decide whether the pending signals delivered during the code block should be discarded or left in place to be treated upon exiting the context manager.
* _signals.py: More reliable suspend/resume context managerTristan Van Berkom2017-04-081-32/+34
| | | | | | | | | | | | | | | It seems that resuming tasks was not happening consistently, sometimes resuming would fail to resume. Changed the code to stop handling SIGCONT completely as to not add any interference in the main child task's SIGCONT handling, instead perform SIGCONT activities in the SIGTSTP handler, directly after issuing SIGSTOP to self, where we implicitly know that if that code is executed, it's because we have now resumed. It's impossible to tell how correct this change is, however after much testing this appears to be entirely reliable, whilst the previous approach continues to be demonstrably unreliable.
* _signals.py: Adding new file to handle per process unix signalsTristan Van Berkom2017-04-071-0/+123
This provides the terminator() and suspendable() context managers previously hiding in utils.py. Additionally, the suspendable() context manager is now recursive like the terminator() is, so we can do more than one thing in a suspendable context (like start/stop timers).