hgext/lfs/blobstore.py
branchstable
changeset 49544 3556f0392808
parent 49543 abf471862b8e
child 49585 18282cf18aa2
--- a/hgext/lfs/blobstore.py	Tue Oct 18 13:36:33 2022 -0400
+++ b/hgext/lfs/blobstore.py	Tue Oct 18 13:56:45 2022 -0400
@@ -597,7 +597,9 @@
                             continue
                         raise
 
-        # Until https multiplexing gets sorted out
+        # Until https multiplexing gets sorted out.  It's not clear if
+        # ConnectionManager.set_ready() is externally synchronized for thread
+        # safety with Windows workers.
         if self.ui.configbool(b'experimental', b'lfs.worker-enable'):
             # The POSIX workers are forks of this process, so before spinning
             # them up, close all pooled connections.  Otherwise, there's no way
@@ -608,7 +610,7 @@
             #  ready connections as in use, and roll that back after the fork?
             #  That would allow the existing pool of connections in this process
             #  to be preserved.
-            if not pycompat.iswindows:
+            def prefork():
                 for h in self.urlopener.handlers:
                     getattr(h, "close_all", lambda: None)()
 
@@ -618,6 +620,7 @@
                 transfer,
                 (),
                 sorted(objects, key=lambda o: o.get(b'oid')),
+                prefork=prefork,
             )
         else:
             oids = transfer(sorted(objects, key=lambda o: o.get(b'oid')))