sourcegraph / sourcegraph-public-snapshot

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

insights: polish handling of errors received from streaming APIs #36414

Open leonore opened 2 years ago

leonore commented 2 years ago

We have the design for exposing errors coming up on the Code Insights roadmap. However, the current state of things is that the insights backend doesn’t have a proper mechanism for handling errors coming from downstream APIs.

Right now the insights backend collects slices of Skipped, Alerts and Errors events received from the search streaming API (and compute API, minus the skipped). Our current setup is that all error events are terminal, alerts are retried, and “skipped reasons” are just logged.

Two examples of where this isn't working:

This issue is just to have a better structure for tabulating non-success events received from streaming APIs, such that we can log/retry/terminate execution accordingly.

sourcegraph-bot-2 commented 2 years ago

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