remotefilelog: prefetch files in deterministic order
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 27 Mar 2019 14:55:46 -0700
changeset 42036 0129bf02fa04
parent 42035 eec20025ada3
child 42037 4606585549b1
remotefilelog: prefetch files in deterministic order I have been troubleshooting some slowness in this area (it's unclear if it's the client or server that's to blame, but that's beside the point) and it's a lot easier to do troubleshoot if the files are prefetched in the same order each time. Differential Revision: https://phab.mercurial-scm.org/D6172
hgext/remotefilelog/fileserverclient.py
--- a/hgext/remotefilelog/fileserverclient.py	Tue Mar 26 17:35:28 2019 +0100
+++ b/hgext/remotefilelog/fileserverclient.py	Wed Mar 27 14:55:46 2019 -0700
@@ -544,7 +544,7 @@
                     if fetchwarning:
                         self.ui.warn(fetchwarning + '\n')
                 self.logstacktrace()
-            missingids = [(file, hex(id)) for file, id in missingids]
+            missingids = [(file, hex(id)) for file, id in sorted(missingids)]
             fetched += len(missingids)
             start = time.time()
             missingids = self.request(missingids)