Skip to content
Tomas Celaya edited this page Dec 29, 2017 · 2 revisions

What happens when a request fails?

MantaClient can automatically retry a request depending on whether the object content is "repeatable." Users of Apache HttpClient (or enterprising individuals which delve into the java-manta source) will recognize this terminology from section 1.1.4.1 of the HttpClient documentation. To summarize the relationship between repeatable entities and request retries, certain classes of errors are simply cannot be retried and certain request entities are incapable of being retried. Both conditions must be satisfied for a request to be retried automatically as described by the following tables:

Entity Repeatable
byte[] yes
String yes
File yes
InputStream* no
OutputStream no
Error Retryable
Initial Connection (unknown host, SSL, etc.) no
Thread interruption (InterruptedIOException) no
Any error occuring during an encrypted Multipart Upload no
Transient errors (Connection reset, etc.) yes

For an automatic retry to occur both conditions must be satisfied. Once a retry is triggered, the retry counter for that request will be incremented and it will be sent again in its entirety. Each decision to retry takes into account the number of attempts so far and the failure that caused the current failure.

InputStreams have some special cases that are worth noting:

  • The stream contains less than manta.upload_buffer_size are buffered into memory and sent as a byte[] and can be repeated.
  • The stream is a FileInputStream so its size can be checked by the client. This can trigger the above scenario.