Skip to content

file: search operator could be better optimized to reduce gitserver IO load

Created by: slimsag

Steps to reproduce:

  1. Be on a Sourcegraph instance with a large number of repositories.
  2. Ensure the Sourcegraph instance has a high maxReposToSearch value (i.e. any large Sourcegraph instance).
  3. In the search field, type just file:a, then quickly in succession hit backspace to erase a and type b, then c, and so on.
  4. You will notice the search suggestions rapidly getting slower. Press enter after a while (e.g. after reaching file:h in the alphabet).
  5. Enter a search query like file:h error which will turn up results. The results will quickly appear, but the code inside of them will take a LONG time to load:

image

Gitserver logs will indicate:

WARN Long exec request [...]