Skip to content

Add 'failed' state to dbworkers and use it in campaigns

Administrator requested to merge mrn/failed-workers into main

Created by: mrnugget

This PR does a few tiny things to fix https://github.com/sourcegraph/sourcegraph/issues/15532:

  • add a failed state to dbworker jobs, to distinguish between jobs that are errored and retryable (errored state) and jobs that errored but won't be retried (failed state)
  • it adds a MarkFailed method to the store
  • it changes the (*workerutil.Worker).handle method to check whether the error returned by the handler is errcode.IsNonRetryable and if so, it marks the job as failed.

The store interface is used by a lot of different implementations, which is why there is so much boilerplate here. The actual changes are maybe ~50 lines of code.

This PR does not change the behaviour of the workers to mark jobs that have exhausted their retries as failed. That could be a future improvement.

Merge request reports

Loading