mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Merge pull request #1254 from jgehrcke/jp/exclog
Do not swallow exception raised during worker exit
This commit is contained in:
commit
081f8eec08
3
THANKS
3
THANKS
@ -160,4 +160,5 @@ Hebert J <hebert@mail.ru>
|
|||||||
Kevin Littlejohn <kevin@littlejohn.id.au>
|
Kevin Littlejohn <kevin@littlejohn.id.au>
|
||||||
Wolfgang Schnerring <wosc@wosc.de>
|
Wolfgang Schnerring <wosc@wosc.de>
|
||||||
Jason Madden <jason@nextthought.com>
|
Jason Madden <jason@nextthought.com>
|
||||||
Eugene Obukhov <irvind25@gmail.com>
|
Eugene Obukhov <irvind25@gmail.com>
|
||||||
|
Jan-Philip Gehrcke <jgehrcke@googlemail.com>
|
||||||
|
|||||||
@ -856,7 +856,7 @@ worker_exit
|
|||||||
def worker_exit(server, worker):
|
def worker_exit(server, worker):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
Called just after a worker has been exited.
|
Called in the worker, right before it terminates.
|
||||||
|
|
||||||
The callable needs to accept two instance variables for the Arbiter and
|
The callable needs to accept two instance variables for the Arbiter and
|
||||||
the just-exited Worker.
|
the just-exited Worker.
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import select
|
|||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
import traceback
|
||||||
|
|
||||||
from gunicorn.errors import HaltServer, AppImportError
|
from gunicorn.errors import HaltServer, AppImportError
|
||||||
from gunicorn.pidfile import Pidfile
|
from gunicorn.pidfile import Pidfile
|
||||||
@ -535,7 +536,8 @@ class Arbiter(object):
|
|||||||
worker.tmp.close()
|
worker.tmp.close()
|
||||||
self.cfg.worker_exit(self, worker)
|
self.cfg.worker_exit(self, worker)
|
||||||
except:
|
except:
|
||||||
pass
|
self.log.warning("Exception during worker exit:\n%s",
|
||||||
|
traceback.format_exc())
|
||||||
|
|
||||||
def spawn_workers(self):
|
def spawn_workers(self):
|
||||||
"""\
|
"""\
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user