Store write failures should result in 500 or 503 response
Klowner opened this issue · 1 comments
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)
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).