changeset 35732:10e62d5efa73

lfs: default to not using workers for upload/download I ran into truncated uploads with this defaulting to on. Wojciech Lis diagnosed it as creating keepalive connections prior to forking, and illegally multiplexing the same connection. [1] I didn't notice a problem with the couple of downloads I tried, but disabled both for simplicity and safety. [1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2018-January/109916.html
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 18 Jan 2018 15:11:34 -0500
parents f58245b9e3ea
children 3d48ae1aaa5e
files hgext/lfs/__init__.py hgext/lfs/blobstore.py
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/lfs/__init__.py	Sun Jan 14 17:00:24 2018 -0500
+++ b/hgext/lfs/__init__.py	Thu Jan 18 15:11:34 2018 -0500
@@ -119,6 +119,9 @@
 configitem('experimental', 'lfs.user-agent',
     default=None,
 )
+configitem('experimental', 'lfs.worker-enable',
+    default=False,
+)
 
 configitem('lfs', 'url',
     default=None,
--- a/hgext/lfs/blobstore.py	Sun Jan 14 17:00:24 2018 -0500
+++ b/hgext/lfs/blobstore.py	Thu Jan 18 15:11:34 2018 -0500
@@ -356,8 +356,13 @@
                             continue
                         raise
 
-        oids = worker.worker(self.ui, 0.1, transfer, (),
-                             sorted(objects, key=lambda o: o.get('oid')))
+        # Until https multiplexing gets sorted out
+        if self.ui.configbool('experimental', 'lfs.worker-enable'):
+            oids = worker.worker(self.ui, 0.1, transfer, (),
+                                 sorted(objects, key=lambda o: o.get('oid')))
+        else:
+            oids = transfer(sorted(objects, key=lambda o: o.get('oid')))
+
         processed = 0
         for _one, oid in oids:
             processed += sizes[oid]