Mercurial > public > mercurial-scm > hg
comparison hgext/lfs/blobstore.py @ 35475: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 |
comparison
equal
deleted
inserted
replaced
35474:16660fd4428d | 35475:b0c01a5ee35c |
---|---|
8 from __future__ import absolute_import | 8 from __future__ import absolute_import |
9 | 9 |
10 import json | 10 import json |
11 import os | 11 import os |
12 import re | 12 import re |
13 import socket | |
13 | 14 |
14 from mercurial.i18n import _ | 15 from mercurial.i18n import _ |
15 | 16 |
16 from mercurial import ( | 17 from mercurial import ( |
17 error, | 18 error, |
284 while True: | 285 while True: |
285 try: | 286 try: |
286 self._basictransfer(obj, action, localstore) | 287 self._basictransfer(obj, action, localstore) |
287 yield 1, obj.get('oid') | 288 yield 1, obj.get('oid') |
288 break | 289 break |
289 except Exception as ex: | 290 except socket.error as ex: |
290 if retry > 0: | 291 if retry > 0: |
291 if self.ui.verbose: | 292 if self.ui.verbose: |
292 self.ui.write( | 293 self.ui.write( |
293 _('lfs: failed: %r (remaining retry %d)\n') | 294 _('lfs: failed: %r (remaining retry %d)\n') |
294 % (ex, retry)) | 295 % (ex, retry)) |