mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 17:37:30 -02:30
import os, fixing bug that forced SIGKILL
This commit is contained in:
@@ -9,6 +9,7 @@ from multiprocessing import Process
|
|||||||
from multiprocessing import Queue as MPQueue
|
from multiprocessing import Queue as MPQueue
|
||||||
from Queue import Empty as QueueEmpty
|
from Queue import Empty as QueueEmpty
|
||||||
from Queue import Full as QueueFull
|
from Queue import Full as QueueFull
|
||||||
|
import os
|
||||||
|
|
||||||
from kombu import Connection, Exchange, Queue
|
from kombu import Connection, Exchange, Queue
|
||||||
from kombu.mixins import ConsumerMixin
|
from kombu.mixins import ConsumerMixin
|
||||||
@@ -42,8 +43,7 @@ class CallbackBrokerWorker(ConsumerMixin):
|
|||||||
signal.signal(signum, signal.SIG_DFL)
|
signal.signal(signum, signal.SIG_DFL)
|
||||||
os.kill(os.getpid(), signum) # Rethrow signal, this time without catching it
|
os.kill(os.getpid(), signum) # Rethrow signal, this time without catching it
|
||||||
except Exception:
|
except Exception:
|
||||||
# TODO: LOG
|
logger.exception('Error in shutdown_handler')
|
||||||
pass
|
|
||||||
return _handler
|
return _handler
|
||||||
|
|
||||||
if use_workers:
|
if use_workers:
|
||||||
@@ -108,7 +108,7 @@ class CallbackBrokerWorker(ConsumerMixin):
|
|||||||
except QueueEmpty:
|
except QueueEmpty:
|
||||||
continue
|
continue
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Exception on worker thread, restarting: " + str(e))
|
logger.info("Exception on worker thread, restarting: " + str(e))
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
if 'job_id' not in body and 'ad_hoc_command_id' not in body:
|
if 'job_id' not in body and 'ad_hoc_command_id' not in body:
|
||||||
|
|||||||
Reference in New Issue
Block a user