-
Notifications
You must be signed in to change notification settings - Fork 736
fix(lambda): fail-open isJobQueued — assume queued on API errors #5130
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -416,10 +416,17 @@ export async function scaleUp(payloads: ActionRequestMessageSQS[]): Promise<stri | |
| }, | ||
| }); | ||
|
|
||
| if (enableJobQueuedCheck && !(await isJobQueued(githubInstallationClient, message))) { | ||
| messageLogger.info('No runner will be created, job is not queued.'); | ||
|
|
||
| continue; | ||
| if (enableJobQueuedCheck) { | ||
| let jobQueued = true; | ||
| try { | ||
| jobQueued = await isJobQueued(githubInstallationClient, message); | ||
| } catch (e) { | ||
| messageLogger.warn('isJobQueued check failed, assuming job is still queued (fail-open)', { error: e }); | ||
| } | ||
| if (!jobQueued) { | ||
| messageLogger.info('No runner will be created, job is not queued.'); | ||
| continue; | ||
| } | ||
| } | ||
|
Comment on lines
+501
to
516
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intentionally broad. The fail-open philosophy here is that dropping a job is always worse than creating an ephemeral runner that self-terminates in ~30s when no work is available. Specific cases:
Narrowing to specific status codes adds a maintenance surface that breaks when GitHub changes error responses. The max downside of fail-open is one extra idle runner for 30s; the max downside of fail-closed is a permanently dropped job. |
||
|
|
||
| scaleUp++; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.