Mercurial > public > mercurial-scm > hg-stable
diff hgext/lfs/blobstore.py @ 35479:b0c01a5ee35c
lfs: narrow the exceptions that trigger a transfer retry
The retries were added to workaround TCP RESETs in fb-experimental fc8c131314a9.
I have no idea if that's been debugged yet, but this wide net caught local I/O
errors, bad hostnames and other things that shouldn't be retried. The next
patch will validate objects as they are uploaded, and there's no need to retry
those errors.
The spec[1] does mention that certain http errors can be retried, including 500.
But let's work through the corruption detection issues first.
[1] https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 04 Dec 2017 21:41:04 -0500 |
parents | 02f54a1ec9eb |
children | 417e8e040102 |
line wrap: on
line diff
--- a/hgext/lfs/blobstore.py Thu Nov 16 22:52:53 2017 -0500 +++ b/hgext/lfs/blobstore.py Mon Dec 04 21:41:04 2017 -0500 @@ -10,6 +10,7 @@ import json import os import re +import socket from mercurial.i18n import _ @@ -286,7 +287,7 @@ self._basictransfer(obj, action, localstore) yield 1, obj.get('oid') break - except Exception as ex: + except socket.error as ex: if retry > 0: if self.ui.verbose: self.ui.write(