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

Check that a pipeline upload error actually comes from the JSON marshaller and exit early #1963

Merged
merged 3 commits into from
Feb 21, 2023

Conversation

triarius
Copy link
Contributor

@triarius triarius commented Feb 21, 2023

In all cases where the pipeline cannot be marshaled to JSON, there is no point to retry the upload.
Retries will keep the agent busy for about 5 min, which is a waste of customers' compute time.

…aller and exit early

While this may be more than just recursive pipeline, in all cases where
the pipeline cannot be marshaled to JSON, there is no point to retry the
upload.

return jsonerr
}

// 422 responses will always fail no need to retry
if apierr, ok := err.(*api.ErrorResponse); ok && apierr.Response.StatusCode == 422 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this part should also use the errors.As pattern as above, there is another PR out there where I have made this change: #1927

When this is merged, that should have merge conflicts. But I will take care of it.

@triarius triarius requested a review from a team February 21, 2023 05:28
Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

@triarius triarius merged commit 91eea56 into main Feb 21, 2023
@triarius triarius deleted the pdp-566-exit-early-when-a-pipeline-contains branch February 21, 2023 05:55
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.

2 participants