Skip to content

Commit

Permalink
Fix multiprocess upload/syncup missing some files
Browse files Browse the repository at this point in the history
- Cause: Baidu will give error {'error_code': 31061, 'error_msg': 'file already exists'} for multiprocess upload as the intermediate directories are being created almost simultaneously.
- Fix: Retry on error 31061 (previously, we don't retry)
  • Loading branch information
houtianze committed Mar 6, 2018
1 parent 5143b77 commit 468144b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ nosetests.xml
bypy/test/**/*.bin
bypy/test/downdir/
bypy/test/sharedir/
bypy/test/configdir/bypy.setting.json
bypy/test/configdir/bypy.hashcache.json
.vscode/tags

4 changes: 2 additions & 2 deletions bypy/bypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def __request_work(self, url, pars, act, method, actargs = None, addtoken = True
self.pd("206 Partial Content (this is OK), processing action")
result = act(r, actargs)
if result == const.ENoError:
self.pd("Request all goes fine")
self.pd("Request OK.")
else:
ec = self.__get_json_errorcode(r, act)
# 6 (sc: 403): No permission to access user data
Expand Down Expand Up @@ -717,7 +717,7 @@ def __request_work(self, url, pars, act, method, actargs = None, addtoken = True
result = ec
# errors that make retrying meaningless
elif (
ec == 31061 or # sc == 400 file already exists
#ec == 31061 or # sc == 400 file already exists
ec == 31062 or # sc == 400 file name is invalid
ec == 31063 or # sc == 400 file parent path does not exist
ec == 31064 or # sc == 403 file is not authorized
Expand Down

0 comments on commit 468144b

Please sign in to comment.