diff --git a/neutron/callbacks/events.py b/neutron/callbacks/events.py index a76bbae5c02..15f4c100cf8 100644 --- a/neutron/callbacks/events.py +++ b/neutron/callbacks/events.py @@ -31,7 +31,8 @@ AFTER_REQUEST = 'after_request' # String literals representing events associated to process operations BEFORE_INIT = 'before_init' -AFTER_INIT = 'after_init' +BEFORE_SPAWN = 'before_spawn' # sent per process +AFTER_INIT = 'after_init' # sent per worker # String literals representing events associated to error conditions ABORT_CREATE = 'abort_create' diff --git a/neutron/service.py b/neutron/service.py index d7308ecf3d4..236b3be2a3c 100644 --- a/neutron/service.py +++ b/neutron/service.py @@ -27,6 +27,9 @@ from oslo_utils import excutils from oslo_utils import importutils from neutron._i18n import _LE, _LI +from neutron.callbacks import events +from neutron.callbacks import registry +from neutron.callbacks import resources from neutron.common import config from neutron.common import profiler from neutron.common import rpc as n_rpc @@ -87,6 +90,7 @@ def serve_wsgi(cls): LOG.exception(_LE('Unrecoverable error: please check log ' 'for details.')) + registry.notify(resources.PROCESS, events.BEFORE_SPAWN, service) return service