diff options
Diffstat (limited to 'geo-replication/syncdaemon')
-rw-r--r-- | geo-replication/syncdaemon/resource.py | 17 | ||||
-rw-r--r-- | geo-replication/syncdaemon/syncdutils.py | 4 |
2 files changed, 11 insertions, 10 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index 306742e53fc..0e718b28344 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -653,11 +653,12 @@ class Server(object): if not matching_disk_gfid(gfid, entry): return - er = errno_wrap(os.unlink, [entry], [ENOENT, ESTALE, EISDIR]) + er = errno_wrap(os.unlink, [entry], [ENOENT, ESTALE, EISDIR], + [EBUSY]) if isinstance(er, int): if er == EISDIR: er = errno_wrap(os.rmdir, [entry], [ENOENT, ESTALE, - ENOTEMPTY]) + ENOTEMPTY], [EBUSY]) if er == ENOTEMPTY: return er @@ -712,7 +713,7 @@ class Server(object): if not matching_disk_gfid(gfid, entry): return er = errno_wrap(os.remove, [fullname], [ENOENT, ESTALE, - EISDIR]) + EISDIR], [EBUSY]) if er == EISDIR: recursive_rmdir(gfid, entry, fullname) @@ -720,7 +721,7 @@ class Server(object): if not matching_disk_gfid(gfid, entry): return - errno_wrap(os.rmdir, [path], [ENOENT, ESTALE]) + errno_wrap(os.rmdir, [path], [ENOENT, ESTALE], [EBUSY]) def rename_with_disk_gfid_confirmation(gfid, entry, en): if not matching_disk_gfid(gfid, entry): @@ -733,7 +734,7 @@ class Server(object): cmd_ret = errno_wrap(os.rename, [entry, en], - [ENOENT, EEXIST], [ESTALE]) + [ENOENT, EEXIST], [ESTALE, EBUSY]) collect_failure(e, cmd_ret) @@ -823,12 +824,12 @@ class Server(object): # we have a hard link, we can now unlink source try: errno_wrap(os.unlink, [entry], - [ENOENT, ESTALE]) + [ENOENT, ESTALE], [EBUSY]) except OSError as e: if e.errno == EISDIR: try: errno_wrap(os.rmdir, [entry], - [ENOENT, ESTALE]) + [ENOENT, ESTALE], [EBUSY]) except OSError as e: if e.errno == ENOTEMPTY: logging.error( @@ -846,7 +847,7 @@ class Server(object): cmd_ret = errno_wrap(Xattr.lsetxattr, [pg, 'glusterfs.gfid.newfile', blob], [EEXIST, ENOENT], - [ESTALE, EINVAL]) + [ESTALE, EINVAL, EBUSY]) failed = collect_failure(e, cmd_ret) # If directory creation is failed, return immediately before diff --git a/geo-replication/syncdaemon/syncdutils.py b/geo-replication/syncdaemon/syncdutils.py index 4d981f9fe53..225ce2c0db5 100644 --- a/geo-replication/syncdaemon/syncdutils.py +++ b/geo-replication/syncdaemon/syncdutils.py @@ -492,12 +492,12 @@ def errno_wrap(call, arg=[], errnos=[], retry_errnos=[]): # probably a screwed state, cannot do much... logging.warn('reached maximum retries (%s)...%s' % (repr(arg), ex)) - return ex.errno + raise time.sleep(0.250) # retry the call def lstat(e): - return errno_wrap(os.lstat, [e], [ENOENT], [ESTALE]) + return errno_wrap(os.lstat, [e], [ENOENT], [ESTALE, EBUSY]) class NoStimeAvailable(Exception): |