diff options
author | Tony Asleson <tasleson@redhat.com> | 2016-06-28 12:07:21 -0500 |
---|---|---|
committer | Tony Asleson <tasleson@redhat.com> | 2016-06-28 12:09:28 -0500 |
commit | dd5d865020acd545712d4bcc0f3236143de4d76d (patch) | |
tree | 00f636886f4613db733273201cb40bddb59a0ba1 /daemons/lvmdbusd/job.py | |
parent | 5274c2f11b9e262588c1dec86609e829618d2e76 (diff) | |
download | lvm2-dd5d865020acd545712d4bcc0f3236143de4d76d.tar.gz |
lvmdbusd: Fix hang when lvm compiled with 'enable-notify-dbus'
The following operations would hang if lvm was compiled with
'enable-notify-dbus' and the client specified -1 for the timeout:
* LV snapshot merge
* VG move
* LV move
This was caused because the implementation of these three dbus methods is
different. Most of the dbus method calls are executed by gathering information
needed to fulfill it, placing that information on a thread safe queue and
returning. The results later to be returned to the client with callbacks.
With this approach we can process an arbitrary number of commands without any
of them blocking other dbus commands. However, the 3 dbus methods listed
above did not utilize this functionality because they were implemented with a
separate thread that handles the fork & exec of lvm. This is done because these
operations can be very slow to complete. However, because of this the lvm
command that we were waiting on is trying to call back into the dbus service to
notify it that something changed. Because the code was blocking the process
that handles the incoming dbus activity the lvm command blocked. We were stuck
until the client timed-out the connection, which then causes the service to
unblock and continue. If the client did not have a timeout, we would have been
hung indefinitely.
The fix is to always utilize the worker queue on all dbus methods. We need to
ensure that lvm is tested with 'enable-notify-dbus' enabled and disabled.
Diffstat (limited to 'daemons/lvmdbusd/job.py')
-rw-r--r-- | daemons/lvmdbusd/job.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/daemons/lvmdbusd/job.py b/daemons/lvmdbusd/job.py index b16f8e6cc..d7f8187e5 100644 --- a/daemons/lvmdbusd/job.py +++ b/daemons/lvmdbusd/job.py @@ -17,7 +17,7 @@ import threading # noinspection PyPep8Naming class JobState(object): - def __init__(self, request): + def __init__(self, request=None): self.rlock = threading.RLock() self._percent = 0 |