1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmdbusd: Don't report recoverable error

Lvm occasionally fails to return all the request JSON keys in the output of
"fullreport".  This happens very rarely.  When it does the daemon was reporting
the resulting informational exception:

MThreadRunner: exception
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/lvmdbusd/utils.py", line 667, in _run
    self.rc = self.f(*self.args)
  File "/usr/lib/python3.9/site-packages/lvmdbusd/fetch.py", line 40, in _main_thread_load
    (lv_changes, remove) = load_lvs(
  File "/usr/lib/python3.9/site-packages/lvmdbusd/lv.py", line 143, in load_lvs
    return common(
  File "/usr/lib/python3.9/site-packages/lvmdbusd/loader.py", line 37, in common
    objects = retrieve(search_keys, cache_refresh=False)
  File "/usr/lib/python3.9/site-packages/lvmdbusd/lv.py", line 95, in lvs_state_retrieve
    l['vdo_operating_mode'],
KeyError: 'vdo_operating_mode'

The daemon retries the operation, which usually works and the daemon continues.
However, simply reporting this informational stack trace is causing CI and other
automated tests to fail as they expect no tracebacks in the log output.

Remove the reporting of this code path unless it persists and causes the daemon
to give up and exit.

Ref: https://bugzilla.redhat.com/show_bug.cgi?id=2120267
This commit is contained in:
Tony Asleson 2022-08-25 09:33:50 -05:00
parent 2918994873
commit 0296e56073
2 changed files with 4 additions and 9 deletions

View File

@ -193,16 +193,14 @@ class StateUpdate(object):
except queue.Empty: except queue.Empty:
pass pass
except Exception as e: except Exception as e:
st = traceback.format_exc()
log_error("update_thread exception: \n%s" % st)
cfg.debug.dump()
cfg.flightrecorder.dump()
exception_count += 1 exception_count += 1
if exception_count >= 5: if exception_count >= 5:
st = traceback.format_exc()
log_error("Too many errors in update_thread, exiting daemon (last exception reported): \n %s" % st)
cfg.debug.dump()
cfg.flightrecorder.dump()
bailing(e) bailing(e)
log_error("Too many errors in update_thread, exiting daemon")
cfg.exit_daemon() cfg.exit_daemon()
else: else:
# Slow things down when encountering errors # Slow things down when encountering errors
time.sleep(1) time.sleep(1)

View File

@ -711,9 +711,6 @@ class MThreadRunner(object):
self.rc = self.f() self.rc = self.f()
except BaseException as be: except BaseException as be:
self.exception = be self.exception = be
st = traceback.format_exc()
log_error("MThreadRunner: exception \n %s" % st)
log_error("Exception will be raised in calling thread!")
def _remove_objects(dbus_objects_rm): def _remove_objects(dbus_objects_rm):