[ https://issues.apache.org/jira/browse/JCLOUDS-1567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Przemysław Sobala closed JCLOUDS-1567. -------------------------------------- Resolution: Not A Bug Sorry, my bad :( I was testing the wrong piece of code. > PROPERTY_MAX_RETRIES does not work with S3 > ------------------------------------------ > > Key: JCLOUDS-1567 > URL: https://issues.apache.org/jira/browse/JCLOUDS-1567 > Project: jclouds > Issue Type: Bug > Components: jclouds-blobstore > Affects Versions: 2.3.0 > Reporter: Przemysław Sobala > Priority: Major > > Hi > I'm using the following code to upload a file to a S3 storage: > {code:java} > final Properties overrides = new Properties(); > overrides.setProperty(PROPERTY_MAX_RETRIES, 2 + ""); > overrides.setProperty(PROPERTY_S3_VIRTUAL_HOST_BUCKETS, "true"); > final BlobStoreContext conn = ContextBuilder.newBuilder("s3") > .credentials(accessKey, secretKey) > .endpoint(endpoint) > .overrides(overrides) > .buildView(BlobStoreContext.class); > store = conn.getBlobStore(); > Blob blob = store.blobBuilder(out.toString()) > .payload(in) > .contentLength(in.length()) > .contentType(Files.probeContentType(in.toPath())) > .cacheControl("max-age=" + CACHE_CONTROL_MAX_AGE) > .build(); > PutOptions putOptions = new PutOptions(); > putOptions.setBlobAccess(BlobAccess.PUBLIC_READ); > if (in.length() > MULTIPART_UPLOAD_THRESHOLD) { > putOptions.multipart(); > } > store.putBlob(bucket, blob, putOptions);{code} > But setting {{PROPERTY_MAX_RETRIES}} to a value of 2 does not work and still > tries 5 times: > {code:java} > SEVERE: Cannot retry after server error, command has exceeded retry limit 5: > [method=org.jclouds.s3.S3Client.public abstract java.lang.String > org.jclouds.s3.S3Client.putObject(java.lang.String,org.jclouds.s3.domain.S3Object,org.jclouds.s3.options.PutObjectOptions[])[devel, > [metadata=[key=live/test2_1615557956853.dat, bucket=null, uri=null, > eTag=null, cacheControl=null, contentMetadata=[cacheControl=max-age=14400, > contentDisposition=null, contentEncoding=null, contentLanguage=null, > contentLength=59093544, contentMD5=null, contentType=video/mp4, > expires=null], lastModified=null, owner=null, storageClass=STANDARD, > userMetadata={}]], [Lorg.jclouds.s3.options.PutObjectOptions;@3ecedf21], > request=PUT http://devel.localhost/live/test2_1615557956853.dat HTTP/1.1] > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)