neutron-lib/neutron_lib/callbacks
Rodolfo Alonso Hernandez 08b8c6d33b Add the "cancellable" flag to the `CallbacksManager` events
The ``CallbacksManager`` class considers, by default, that the events
starting with "before_" and "precommit_" can raise an Exception
(``CallbackFailure``) in case that the callbacks associated to these
methods exit with an error.

However there are some other events (those started with "after_") that
won't generate an exception in case of error. The error will be logged
but the process will continue.

This new functionality adds the possibility of adding any kind of event
and mark is as "cancellable". The ``CallbacksManager`` instance will check
the errors returned by the callback methods and if any of them is marked
as "cancellable", the manager will raise a ``CallbackFailure`` exception,
terminating the process.

In case of being a Neutron worker, for example, the
``oslo_service.service.Services`` class will restart the process again.

Related-Bug: #2036607
Change-Id: Ie1e7be6d70cca957c1b1b6c15b402e8bc6523865
2023-09-12 04:32:26 +00:00
..
__init__.py Expose/Improve callback notification interface 2017-01-11 13:47:12 -07:00
events.py Add the "cancellable" flag to the `CallbacksManager` events 2023-09-12 04:32:26 +00:00
exceptions.py Add the "cancellable" flag to the `CallbacksManager` events 2023-09-12 04:32:26 +00:00
manager.py Add the "cancellable" flag to the `CallbacksManager` events 2023-09-12 04:32:26 +00:00
priority_group.py callback: priority to specify calling order 2018-03-22 18:20:25 +00:00
registry.py Add the "cancellable" flag to the `CallbacksManager` events 2023-09-12 04:32:26 +00:00
resources.py Add Local IP constants and exceptions 2021-08-31 19:20:34 +03:00