-
-
Notifications
You must be signed in to change notification settings - Fork 731
v3: Cancel awaited subtasks and reliable rate-limit recovery #1200
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
Conversation
🦋 Changeset detectedLatest commit: 202a2fb 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 |
4f9b10a
to
df20d43
Compare
- Changing from sliding window to token bucket in the API rate limiter, to help smooth out traffic - Adding spans to the API Client core & SDK functions - Added waiting spans when retrying in the API Client - Retrying in the API Client now respects the x-ratelimit-reset - Retrying ApiError’s in tasks now respects the x-ratelimit-reset - Added AbortTaskRunError that when thrown will stop retries - Added idempotency keys SDK functions and automatically injecting the run ID when inside a task - Added the ability to configure ApiRequestOptions (retries only for now) globally and on specific calls - Implement the maxAttempts TaskRunOption (it wasn’t doing anything before)
df20d43
to
edd6342
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self-reviewed 👍
|
…ex on BatchTaskRun and TaskRun
const cancelService = new CancelTaskRunService(); | ||
|
||
// Cancel any dependent task runs | ||
for (const attempt of cancelledTaskRun.attempts) { | ||
for (const dependency of attempt.dependencies) { | ||
await cancelService.call(dependency.taskRun, { | ||
...opts, | ||
reason: `Parent task run was cancelled`, | ||
}); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be here?
triggerAndWait
orbatchTriggerAndWait
), those subtasks will now also be cancelled (and any of their subtasks). Tasks triggered withtrigger
orbatchTrigger
will not be cancelled.