Remove dead code of api.fault notification sending
Based on the description of the notify_on_api_faults config option [1]
and the code that uses it [2] nova sends and api.fault notification
if the nova-api service encounters an unhandle exception.
There is a FaultWrapper class [3] added to the pipeline of the REST
request which catches every exception and calls the notification sending.
Based on some debugging in devstack this FaultWrapper never catches any
exception. Every REST API method is decorated with expected_errors
decorator [5] which as a last resort translate the unexpected exception
to HTTPInternalServerError. In the wsgi stack the actual REST api call is
guarded with ResourceExceptionHandler context manager [7] which translates
HTTPException to a Fault [8]. Then Fault is catched and translated to
the REST response [7]. This way the exception never propagates back to
the FaultWrapper and therefore the api.fault notification is never emitted.
Based on the git history of the expected_errors decorator this notification
was never emitted for v2.1 API and as the v2.0 API now supported with the
same codebase than v2.1 it is not emitted for v2.0 calls either. As nobody
reported a bug I assume that nobody tried to use this notification for a very
long time. Therefore instead of fixing this bug this patch propses to remove
the dead code.
See a bit more detailed description on the ML [9].
Reviewed: https:/ /review. openstack. org/505164 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=0d4c3cc65b7 8bafef69afc45cb 156afe38f857c3
Committed: https:/
Submitter: Jenkins
Branch: master
commit 0d4c3cc65b78baf ef69afc45cb156a fe38f857c3
Author: Balazs Gibizer <email address hidden>
Date: Mon Sep 18 16:53:32 2017 +0200
Remove dead code of api.fault notification sending
Based on the description of the notify_ on_api_ faults config option [1]
and the code that uses it [2] nova sends and api.fault notification
if the nova-api service encounters an unhandle exception.
There is a FaultWrapper class [3] added to the pipeline of the REST
request which catches every exception and calls the notification sending.
Based on some debugging in devstack this FaultWrapper never catches any verError. In the wsgi stack the actual REST api call is onHandler context manager [7] which translates
exception. Every REST API method is decorated with expected_errors
decorator [5] which as a last resort translate the unexpected exception
to HTTPInternalSer
guarded with ResourceExcepti
HTTPException to a Fault [8]. Then Fault is catched and translated to
the REST response [7]. This way the exception never propagates back to
the FaultWrapper and therefore the api.fault notification is never emitted.
Based on the git history of the expected_errors decorator this notification
was never emitted for v2.1 API and as the v2.0 API now supported with the
same codebase than v2.1 it is not emitted for v2.0 calls either. As nobody
reported a bug I assume that nobody tried to use this notification for a very
long time. Therefore instead of fixing this bug this patch propses to remove
the dead code.
See a bit more detailed description on the ML [9].
[1] https:/ /github. com/openstack/ nova/blob/ 0aeaa2bce8ad15b c2f28e00b30d688 514b992e13/ nova/conf/ notifications. py#L49 /github. com/openstack/ nova/blob/ 0aeaa2bce8ad15b c2f28e00b30d688 514b992e13/ nova/notificati ons/base. py#L84 /github. com/openstack/ nova/blob/ 0aeaa2bce8ad15b c2f28e00b30d688 514b992e13/ nova/api/ openstack/ __init_ _.py#L78 /github. com/openstack/ nova/blob/ 0aeaa2bce8ad15b c2f28e00b30d688 514b992e13/ nova/api/ openstack/ extensions. py#L325 /github. com/openstack/ nova/blob/ 0aeaa2bce8ad15b c2f28e00b30d688 514b992e13/ nova/api/ openstack/ wsgi.py# L637 /github. com/openstack/ nova/blob/ 0aeaa2bce8ad15b c2f28e00b30d688 514b992e13/ nova/api/ openstack/ wsgi.py# L418 lists.openstack .org/pipermail/ openstack- dev/2017- June/118639. html
[2] https:/
[3] https:/
[5] https:/
[7] https:/
[8] https:/
[9] http://
Change-Id: I608b6ebdc69d31 eb2a11ac6479fa4 f2e8c20f7d1
Closes-Bug: #1699115