Skip to content

job: timeout between check and wait, not the other way around

Eric Engestrom requested to merge 1ace/marge-bot:timeout-fix into main

The current behaviour is:

  • check timeout
  • check pipeline
  • wait
  • check timeout
  • check pipeline
  • ...

The problem is that if the pipeline finishes (especially with a success) while we're waiting, we waited for nothing, and the user gets a frustrating experience where the pipeline passes and then Marge times out.

Instead, let's do this:

  • check pipeline
  • check timeout after wait
  • wait
  • check pipeline
  • ...

The trick here is to add the length of the wait to the timeout check, so that we avoid waiting if we're going to timeout after it anyway. In turn, this means that there is time for one more iteration of checking if the pipeline finished before timing out.

Merge request reports