Free up concurrency when using triggerAndWait. Improved errors on runs #1272
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Freeing up concurrency
When using
triggerAndWait()
orbatchTriggerAndWait()
free up concurrency for the environment and org straight away. If it's a recursive task (i.e. the task calls itself again) then also free up the concurrency for the task queue.This fixes some issues where at maximum concurrency it's possible for a run to get stuck. In production runs were clearing their concurrency after the heartbeats failed, but this slowed down execution by up to 2 mins.
Adding errors when failing runs
When a run fails, we now ensure there is an error on the final attempt (if there isn't already one). There were some runs with "SYSTEM_FAILURE" but no information on why, except in the logs which is hard to dig out.
Run inspector error
We were showing run errors even if attempts were still happening. This was confusing. Now we only show an error on the run if the run is in a final state. You can still see attempt errors on the individual attempts.