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

Store write failures should result in 500 or 503 response #8

Open
Klowner opened this issue Jan 20, 2023 · 1 comment
Open

Store write failures should result in 500 or 503 response #8

Klowner opened this issue Jan 20, 2023 · 1 comment

Comments

@Klowner
Copy link
Owner

Klowner commented Jan 20, 2023

Right now the create handler returns a 400: Bad Request if there's a write failure by the storage service.
Clients should not re-attempt requests that produce a 400, but in our case, the client should retry.

Consider responding to the client with a 500: Internal Server Error or 503: Service Unavailable.

(tus-js-client does not attempt to retry in the case of a 4xx response)

@Klowner
Copy link
Owner Author

Klowner commented May 28, 2023

tus-js-client's default shouldRetry method does not retry if the server response is 4xx (except for 409 and 423).

I think I'll add capabilities for storage services to return errors which signify whether or not the client should retry, essentially letting storage service signal temporary or fatal errors separately.

If the client should retry, we will return 503 Service Unavailable (which is the typical case for storage write failures, sometimes R2 is finicky and fails writes).

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

No branches or pull requests

1 participant