Skip to content
Snippets Groups Projects
Commit 3ef89352 authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

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.
parent ee45f5c2
No related merge requests found
......@@ -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()
......
......@@ -311,6 +311,6 @@
searching for changes
taking quick initial sample
searching: 2 queries
query 2; still undecided: 1080, sample size is: 260
query 2; still undecided: 1240, sample size is: 260
sampling from both directions
searching: 3 queries
......@@ -315,5 +315,5 @@
sampling from both directions
searching: 3 queries
query 3; still undecided: 820, sample size is: 260
query 3; still undecided: 980, sample size is: 260
sampling from both directions
searching: 4 queries
......@@ -318,5 +318,5 @@
sampling from both directions
searching: 4 queries
query 4; still undecided: 560, sample size is: 260
query 4; still undecided: 720, sample size is: 260
sampling from both directions
searching: 5 queries
......@@ -321,6 +321,6 @@
sampling from both directions
searching: 5 queries
query 5; still undecided: 300, sample size is: 200
query 5; still undecided: 460, sample size is: 200
5 total queries
common heads: 3ee37d65064a
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment