diff mercurial/setdiscovery.py @ 23084:3ef893520a85 stable

setdiscovery: limit the size of the initial sample (issue4411) The set discovery start by sending a "known" command with all local heads. When the number of local heads is massive (eg: using hidden changesets) such request becomes too large. This lead to 414 error over http, aborting the whole process. We limit the size of the sample used by the first query to fix this. The test are impacted because they do test massive number of heads. But they do not test it over real world http setup.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 27 Oct 2014 17:52:33 +0100
parents ee45f5c2ffcc
children ced632394371
line wrap: on
line diff
--- a/mercurial/setdiscovery.py	Mon Oct 27 17:40:32 2014 +0100
+++ b/mercurial/setdiscovery.py	Mon Oct 27 17:52:33 2014 +0100
@@ -133,7 +133,7 @@
     ui.debug("query 1; heads\n")
     roundtrips += 1
     ownheads = dag.heads()
-    sample = ownheads
+    sample = _limitsample(ownheads, initialsamplesize)
     if remote.local():
         # stopgap until we have a proper localpeer that supports batch()
         srvheadhashes = remote.heads()