Skip to content
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

fix: runtime ready loop #115

Merged
merged 11 commits into from
Oct 23, 2024
Merged

fix: runtime ready loop #115

merged 11 commits into from
Oct 23, 2024

Conversation

loks0n
Copy link
Member

@loks0n loks0n commented Oct 22, 2024

When you make a request to create an execution, and the runtime doesn't exist yet, the executor tries to create the runtime first. If the runtime is already being created by another request (and exists in the activeRuntimes table with a 'pending' status), the /v1/runtimes endpoint returns a 409 Conflict error with the message:

A runtime with the same ID is already being created. Attempt a execution soon.

In the execution creation code, specifically in the loop that attempts to create the runtime, any HTTP response with a status code between 400 and 499 (inclusive) is treated as a fatal error, and it immediately throws an exception instead of retrying. This means that when the executor receives a 409 status code, it doesn't retry and instead exits the loop, leading to this error on sentry.

An internal curl error has occurred while starting runtime! Error Msg: A runtime with the same ID is already being created. Attempt a execution soon.

This PR excludes 409 responses from the check to avoid throwing an immediate exception.

@loks0n loks0n requested a review from christyjacob4 October 22, 2024 11:34
@christyjacob4 christyjacob4 merged commit 4c98340 into main Oct 23, 2024
3 checks passed
@christyjacob4 christyjacob4 deleted the fix-curl-errors branch October 23, 2024 13:54
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.

3 participants