diff options
author | Kotresh HR <khiremat@redhat.com> | 2018-02-12 03:11:04 -0500 |
---|---|---|
committer | Kotresh HR <khiremat@redhat.com> | 2018-02-22 05:40:35 +0000 |
commit | e4ca0b3df379c553e220f929f0203175bd536b61 (patch) | |
tree | b4e673999ea45bf1a5370015e19d5241bf4aa965 /geo-replication/syncdaemon/syncdutils.py | |
parent | 961370d995400b68afe520207593b8cc59846448 (diff) |
geo-rep: Remove lazy umount and use mount namespaces
Lazy umounting the master volume by worker causes
issues with rsync's usage of getcwd. Henc removing
the lazy umount and using private mount namespace
for the same. On the slave, the lazy umount is
retained as we can't use private namespace in non
root geo-rep setup.
Change-Id: I403375c02cb3cc7d257a5f72bbdb5118b4c8779a
BUG: 1546129
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/syncdutils.py')
-rw-r--r-- | geo-replication/syncdaemon/syncdutils.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/geo-replication/syncdaemon/syncdutils.py b/geo-replication/syncdaemon/syncdutils.py index e546f558265..1e40ff56858 100644 --- a/geo-replication/syncdaemon/syncdutils.py +++ b/geo-replication/syncdaemon/syncdutils.py @@ -68,9 +68,6 @@ PERCENTAGE_ESCAPE_CHAR = "%25" final_lock = Lock() -mntpt_list = [] - - def sup(x, *a, **kw): """a rubyesque "super" for python ;) @@ -254,12 +251,16 @@ def finalize(*args, **kwargs): shutil.rmtree(rconf.ssh_ctl_dir, onerror=handle_rm_error) """ Unmount if not done """ - for mnt in mntpt_list: - p0 = subprocess.Popen(["umount", "-l", mnt], stderr=subprocess.PIPE) + if rconf.mount_point: + if rconf.mountbroker: + umount_cmd = rconf.mbr_umount_cmd + [rconf.mount_point, 'lazy'] + else: + umount_cmd = ['umount', '-l', rconf.mount_point] + p0 = subprocess.Popen(umount_cmd, stderr=subprocess.PIPE) _, errdata = p0.communicate() if p0.returncode == 0: try: - os.rmdir(mnt) + os.rmdir(rconf.mount_point) except OSError: pass else: @@ -279,6 +280,7 @@ def log_raise_exception(excont): Translate some weird sounding but well understood exceptions into human-friendly lingo """ + is_filelog = False for h in logging.getLogger().handlers: fno = getattr(getattr(h, 'stream', None), 'fileno', None) |