← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1808917] [NEW] RetryRequest shouldn't log stack trace by default, or it should be configuarble by the exception

 

Public bug reported:

I see the following littering the logs and it strikes me as wrong:

2018-12-18 01:01:46.259 34 DEBUG neutron.plugins.ml2.managers [req-196ce43f-2408-48f4-9c7e-bb90f66c9c14 - - - - -] DB exception raised by Mechanism driver 'opendaylight_v2' in update_port_precommit _call_on_drivers /usr/lib/python2.7/site-packages/neutron/plugins/ml2/managers.py:434
2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers Traceback (most recent call last):
2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/managers.py", line 427, in _call_on_drivers
2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers     getattr(driver.obj, method_name)(context)
2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/oslo_log/helpers.py", line 67, in wrapper
2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers     return method(*args, **kwargs)
2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/networking_odl/ml2/mech_driver_v2.py", line 117, in update_port_precommit
2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers     context, odl_const.ODL_PORT, odl_const.ODL_UPDATE)
2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/networking_odl/ml2/mech_driver_v2.py", line 87, in _record_in_journal
2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers     ml2_context=context)
2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/networking_odl/journal/journal.py", line 123, in record
2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers     raise exception.RetryRequest(e)
2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers RetryRequest
2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers 

Since this is an explicit request by the operation to retry, and not some unexpected behavior, it shouldn't log the stack trace.
If you really want more fine grained control (over not logging the trace completely), a flag can be added to the exception to determine whether the log of it should contain the stack trace or not.

The code in question is here (also on master but this rocky url is simpler):
https://github.com/openstack/neutron/blob/stable/rocky/neutron/plugins/ml2/managers.py#L433

** Affects: neutron
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1808917

Title:
  RetryRequest shouldn't log stack trace by default, or it should be
  configuarble by the exception

Status in neutron:
  New

Bug description:
  I see the following littering the logs and it strikes me as wrong:

  2018-12-18 01:01:46.259 34 DEBUG neutron.plugins.ml2.managers [req-196ce43f-2408-48f4-9c7e-bb90f66c9c14 - - - - -] DB exception raised by Mechanism driver 'opendaylight_v2' in update_port_precommit _call_on_drivers /usr/lib/python2.7/site-packages/neutron/plugins/ml2/managers.py:434
  2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers Traceback (most recent call last):
  2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/managers.py", line 427, in _call_on_drivers
  2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers     getattr(driver.obj, method_name)(context)
  2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/oslo_log/helpers.py", line 67, in wrapper
  2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers     return method(*args, **kwargs)
  2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/networking_odl/ml2/mech_driver_v2.py", line 117, in update_port_precommit
  2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers     context, odl_const.ODL_PORT, odl_const.ODL_UPDATE)
  2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/networking_odl/ml2/mech_driver_v2.py", line 87, in _record_in_journal
  2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers     ml2_context=context)
  2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/networking_odl/journal/journal.py", line 123, in record
  2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers     raise exception.RetryRequest(e)
  2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers RetryRequest
  2018-12-18 01:01:46.259 34 ERROR neutron.plugins.ml2.managers 

  Since this is an explicit request by the operation to retry, and not some unexpected behavior, it shouldn't log the stack trace.
  If you really want more fine grained control (over not logging the trace completely), a flag can be added to the exception to determine whether the log of it should contain the stack trace or not.

  The code in question is here (also on master but this rocky url is simpler):
  https://github.com/openstack/neutron/blob/stable/rocky/neutron/plugins/ml2/managers.py#L433

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1808917/+subscriptions