sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.1k stars 1.28k forks source link

gitMaxConcurrentClones is both global and gitserver-local #11727

Closed slimsag closed 4 years ago

slimsag commented 4 years ago

Just an unimportant bug I noticed:

We use gitMaxConcurrentClones to limit the concurrent requests from repo-updater ->.gitserver here: https://sourcegraph.com/github.com/sourcegraph/sourcegraph@2d9677462cfd141f9c6a6e98ed9754a013391ae6/-/blob/cmd/repo-updater/repos/scheduler.go#L213-223

In other words, that applies globally to all gitservers.

But when individual gitservers go to use the same thing, they apply it per-gitserver: https://sourcegraph.com/github.com/sourcegraph/sourcegraph@2d9677462cfd141f9c6a6e98ed9754a013391ae6/-/blob/cmd/gitserver/server/server.go#L203-223

Presumably we want these to enforce the same number - not have repo-updater be global and gitserver be per-gitserver?

keegancsmith commented 4 years ago

Not really a bug but known and intentional. Maybe the fix is to better document, will send out a more detailed explanation in a PR. We intentionally give "extra" limit per-gitserver to allow it to run fetch in response to missing revs. In the steady state for customers the global limit will be gitMaxConcurrentClones since they mainly come from repo-updater.