~ev/uci-engine/guard-against-breaking-virtualenvs

« back to all changes in this revision

Viewing changes to bin/called-by-tarmac.py

  • Committer: Ubuntu CI Bot
  • Author(s): Vincent Ladeuil
  • Date: 2014-11-21 13:42:55 UTC
  • mfrom: (893.2.2 sighandlers)
  • Revision ID: ubuntu_ci_bot-20141121134255-6xo1qu637pe94obt
Clarify sighandler implementation [r=Joe Talbott, PS Jenkins bot]

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
        """
148
148
        metrics.timing('counters.failures.killed')
149
149
        logging.info('Received signal {}, exiting'.format(signum))
150
 
        signal.signal(signum, signal.SIG_DFL)
 
150
        # We don't want to be interrupted while we process the signal, we're
 
151
        # exiting anyway.
 
152
        signal.signal(signum, signal.SIG_IGN)
151
153
 
152
 
        # When tarmac kills us, we want the MP to be attempted again so we
153
 
        # pretend all went well (software rightly believe in cycle of
154
 
        # reincarnation so dieing is not a failure ;).
155
 
        sys.exit(0)
 
154
        # When tarmac kills us, we'll exit with a -SIGNAL return code, so the
 
155
        # value below will be overriden.
 
156
        sys.exit(42)
156
157
 
157
158
    # Be ready to die. We use some atexit handlers that need to be called in
158
159
    # all cases or we'll leak in various places.