Skip to content

Free up concurrency when using triggerAndWait. Improved errors on runs #1272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 25, 2024

Conversation

matt-aitken
Copy link
Member

@matt-aitken matt-aitken commented Aug 25, 2024

Freeing up concurrency

When using triggerAndWait() or batchTriggerAndWait() 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.

Copy link

changeset-bot bot commented Aug 25, 2024

🦋 Changeset detected

Latest commit: 7ff6901

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented Aug 25, 2024

commit: 7ff6901

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/build@1272
pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev@1272
pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/core@1272
pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/sdk@1272

Open in Stackblitz

@matt-aitken matt-aitken merged commit f7d32b8 into main Aug 25, 2024
4 checks passed
@matt-aitken matt-aitken deleted the reliability-improvements branch August 25, 2024 19:15
D-K-P pushed a commit that referenced this pull request Sep 9, 2024
#1272)

* Add an error to the final attempt if there isn’t one

* Improved the checkpointResumer test task

* Using triggerAndWait or batchTriggerAndWait frees up concurrency

Normally it frees up just env and org concurrency. If it’s a recursive task then it will free up the run concurrency too (e.g. a task calling itself).

* Removed the filepath and export name from attempt spans

* Run inspector: only show an error if the run is in a finished state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant