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

[ONPREM-1972] Don't re-handle task errors #133

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

christian-stephen
Copy link
Member

@christian-stephen christian-stephen commented Feb 24, 2025

Don't re-handle task errors. If GOAT handles a task error (either with an infra-fail or retry), don't exit with a nonzero status code. Doing so causes container agent to overwrite the original error message in the UI.

⚙️ Issue

https://circleci.atlassian.net/browse/ONPREM-1972


⚙️ Change Description

Acceptance Criteria:


Solution


Testing

Before: https://app.circleci.com/pipelines/github/circleci/runner-dummy/3032/workflows/2756dd1b-3af4-4305-b7d2-0effbd68b000/jobs/193765

After: https://app.circleci.com/pipelines/github/circleci/runner-dummy/3032/workflows/23a63cf9-4ee1-4a53-b6d3-c41d9ff7b5b6/jobs/193764

  • Created and updated tests where applicable

📖 Documentation Updates

  • Updated related documentation, if applicable
  • Updated changelog

@christian-stephen christian-stephen force-pushed the ONPREM-1972/handle-errors branch 2 times, most recently from dfdb462 to ace4a71 Compare February 24, 2025 13:27
@christian-stephen christian-stephen changed the title Don't re-handle task errors [ONPREM-1972] Don't re-handle task errors Feb 24, 2025
@christian-stephen christian-stephen marked this pull request as ready for review February 24, 2025 13:37
@christian-stephen christian-stephen requested a review from a team as a code owner February 24, 2025 13:37
@@ -226,9 +230,10 @@ func (o *Orchestrator) handleErrors(ctx context.Context, err error) error {
failErr := o.runnerClient.FailTask(ctx, time.Now(), c.Allocation, err.Error())
if failErr != nil {
failErr = fmt.Errorf("failed to send fail event for task: %w", failErr)
return errors.Join(failErr, unclaimErr, err)
Copy link
Member Author

Choose a reason for hiding this comment

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

If GOAT fails to infra-fail the task, then let container-agent handle it

If GOAT handles a task error (either with an infra-fail or retry), don't exit with a nonzero status code. Doing so causes container agent to overwrite the original error message in the UI.
@christian-stephen christian-stephen force-pushed the ONPREM-1972/handle-errors branch from ace4a71 to 8891b87 Compare February 24, 2025 13:46
ctx := o.taskContext(parentCtx)
o.reaper.Enable(ctx)

defer func() {
err = o.shutdown(ctx, err)
o11y.End(span, &err)
Copy link
Member Author

Choose a reason for hiding this comment

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

The original error will always get set on the span, so if GOAT fails to infra-fail or retry the task, then we can still see the error in the logs

@christian-stephen christian-stephen merged commit a856005 into main Feb 24, 2025
7 of 8 checks passed
@christian-stephen christian-stephen deleted the ONPREM-1972/handle-errors branch February 24, 2025 14:14
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