sourcegraph / sourcegraph-public-snapshot

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

insights: better surface errors #18964

Open slimsag opened 3 years ago

slimsag commented 3 years ago

The backend's queryrunner runs search queries here, and there are a number of reasons that a search query could result in an error where "retrying later" is not strictly an obvious option and we have to decide what to do:

the function where these errors are produced and handled: https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+lang:go+file:insights/background/queryrunner+content:%22%29+Handle%28%22&patternType=literal

github-actions[bot] commented 3 years ago

Heads up @joelkw @felixfbecker - the "team/code-insights" label was applied to this issue.

coury-clark commented 3 years ago

We hit a search limit when searching. Theoretically should never happen because we specify count:9999999 in all queries - but could happen if search is really strained for resources I guess. In this case, we log an error, record what we got, and never retry.

Just a note, any queries that hit a limit are now flagged as dirty and exposed as metadata through the insights GraphQL API.

Leaving this issue open to address points 1, 3.