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

Allow retry of 500 API errors to be handled by restart policies #3073

Merged
merged 1 commit into from
Aug 24, 2017

Conversation

clinta
Copy link
Contributor

@clinta clinta commented Aug 22, 2017

API error 500 from docker is often recoverable, in our case we typically see this error from a volume driver after a container crashes. The volume driver must wait for a timeout from the now dead container before allowing a new container to mount it. This can take longer than 5 seconds.

Allowing these retires to be handled by the jobs configured restart policies seems to be a more intuitive solution than having a special hard-coded retry just for these errors.

time.Sleep(1 * time.Second)
goto START
}
return structs.NewRecoverableError(startErr, true)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you change it such that we still retry quickly for 5 times and then fall back to the recoverable error if it is a 500? We want the fast retry behavior in this case since often it recovers quickly and the users restart policy may cause the task to fail.

@dadgar
Copy link
Contributor

dadgar commented Aug 24, 2017

Thanks @clinta

@dadgar dadgar merged commit ba1eecb into hashicorp:master Aug 24, 2017
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants