Retries for operations that upload binary data without request-level retries do not retry in OCI Java SDK versions 3.0.0 to 3.31.0
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Iniziare con le classi di request interessate elencate nell’issue e con com.oracle.bmc.objectstorage.transfer.UploadManager, quindi esaminare la gestione di RetryConfiguration e la modifica segnalata nella versione 3.31.1. Verificare che i retry degli upload da stream vengano reimpostati correttamente senza una configurazione a livello di request e che le soluzioni alternative documentate corrispondano al comportamento attuale dell’SDK.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
If you are using any of the OCI Java SDK synchronous clients that upload streams of data, e.g. ObjectStorageClient or DataSafeClient, and you do not define the RetryConfiguration at request level, your requests will not be automatically retried. However, there is no chance of silent data corruption.
Description
When using OCI Java SDK (versions 3.0.0 to 3.31.0) for operations that have retries enabled by default, and you do not define the RetryConfiguration at request level, and the request fails with a retry-able error, the OCI Java SDK should automatically retry the request. In this situation, the clients fail to reset the stream position for requests that upload streams. As a result, retries cannot be attempted, and the operation fails with a BmcException.
The upload of the stream is likely incomplete at this time and needs to be re-attempted. Fortunately, this failure is visible and therefore cannot lead to silent data corruption.
Affected requests
This happens only for synchronous clients in versions 3.0.0 to 3.31.0:
com.oracle.bmc.objectstorage.requests.PutObjectRequestcom.oracle.bmc.objectstorage.requests.UploadPartRequestcom.oracle.bmc.datasafe.requests.UploadSensitiveDataModelRequestcom.oracle.bmc.datasafe.requests.UploadMaskingPolicyRequestcom.oracle.bmc.loganalytics.requests.RegisterLookupRequestcom.oracle.bmc.loganalytics.requests.UpdateLookupDataRequestcom.oracle.bmc.loganalytics.requests.AppendLookupDataRequestcom.oracle.bmc.loganalytics.requests.ImportCustomContentRequestcom.oracle.bmc.loganalytics.requests.UploadDiscoveryDataRequestcom.oracle.bmc.loganalytics.requests.UploadLogFileRequestcom.oracle.bmc.loganalytics.requests.UploadLogEventsFileRequestcom.oracle.bmc.keymanagement.requests.RestoreVaultFromFileRequestcom.oracle.bmc.keymanagement.requests.RestoreKeyFromFileRequestcom.oracle.bmc.datascience.requests.CreateModelArtifactRequestcom.oracle.bmc.datascience.requests.CreateJobArtifactRequestcom.oracle.bmc.datascience.requests.CreateStepArtifactRequestcom.oracle.bmc.marketplacepublisher.requests.UpdateTermVersionContentRequestcom.oracle.bmc.marketplacepublisher.requests.UpdateListingRevisionIconContentRequestcom.oracle.bmc.marketplacepublisher.requests.CreateTermVersionRequestcom.oracle.bmc.marketplacepublisher.requests.UpdateListingRevisionAttachmentContentRequestcom.oracle.bmc.genericartifactscontent.requests.PutGenericArtifactContentByPathRequestcom.oracle.bmc.dns.requests.CreateZoneFromZoneFileRequestcom.oracle.bmc.networkfirewall.requests.BulkUploadSecurityRulesRequestcom.oracle.bmc.networkfirewall.requests.BulkUploadServicesRequestcom.oracle.bmc.networkfirewall.requests.BulkUploadServiceListsRequestcom.oracle.bmc.networkfirewall.requests.BulkUploadApplicationsRequestcom.oracle.bmc.networkfirewall.requests.BulkUploadAddressListsRequestcom.oracle.bmc.networkfirewall.requests.BulkUploadDecryptionRulesRequestcom.oracle.bmc.networkfirewall.requests.BulkUploadUrlListsRequestcom.oracle.bmc.networkfirewall.requests.BulkUploadMappedSecretsRequestcom.oracle.bmc.networkfirewall.requests.BulkUploadApplicationGroupsRequestcom.oracle.bmc.networkfirewall.requests.BulkUploadDecryptionProfilesRequestcom.oracle.bmc.cloudmigrations.requests.ImportMigrationPlanRequestcom.oracle.bmc.opsi.requests.PutAwrHubObjectRequestcom.oracle.bmc.functions.requests.InvokeFunctionRequest
You are also affected if you use the Object Storage Upload Manager:
Operations that do not upload streams are not affected.
If the stream that is being uploaded is a ByteArrayInputStream, operations are not affected.
To summarize, you are affected if you
- use versions
3.0.0to3.31.0 - and upload streams using the above operations,
- and do not set a retry configuration at request level
Workarounds
This problem was fixed in version 3.31.1. If you are using any of the affected versions, we recommend that you upgrade to version 3.31.1 or later.
If, for some reason, you cannot upgrade to version 3.31.1 or later, here are some other possible workarounds:
- Set the
RetryConfigurationat request level by following this example.- The easiest way to do this is to insert the default retry policy at request level:
final PutObjectRequest putObjectRequest = PutObjectRequest.builder() .retryConfiguration( com.oracle.bmc.retrier.RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION) // other request parameters .build();
- The easiest way to do this is to insert the default retry policy at request level:
- Disable default retries by following any of the methods described here.
- Buffer the data in memory yourself by first copying it into a
ByteArrayInputSteam, and then use thatByteArrayInputStreamin your upload operation.
**Update
We had previously stated that there may be a potential data corruption issue. Our initial fear was that the first attempt may fail, and subsequent retries fail to reset the stream and therefore do not upload the entire stream again, leading to missing data. During careful evaluation, we determined that data corruption does not occur.
Instead, the first retry fails with an exception:
Caused by: java.lang.RuntimeException: Stream {} does not support mark/reset, retries do not work
This is still far from ideal, but a hard, visible failure is preferable to silent data corruption.
**Update 2
This problem was fixed in version 3.31.1.
- Lingua principale
- Java
- Stelle
- 243
- Fork
- 171
- Merge medio
- 5m
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di oracle/oci-java-sdk
-
NoSuchMethodError in the circuit breaker since 3.103.0 when resilience4j 2.x is on the classpathAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
oracle/oci-java-sdk#803 ·
-
Potential token refresh timeout issue in Versions 2.91.0, 2.93.0, and 2.95.0 (Fixed in 2.97.0)ApertaSDK
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 20/100
oracle/oci-java-sdk#788 ·
-
Identity Domains
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
oracle/oci-java-sdk#764 · 3 commenti ·
-
SDK
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
oracle/oci-java-sdk#726 · 1 commento ·
-
Object Storage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
oracle/oci-java-sdk#723 · 1 reazione ·
Tutte le issue di oracle/oci-java-sdk
Issue simili
-
enhancement infra
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
5.0.x backport bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
spring-cloud/spring-cloud-function#1569 ·
I maintainer di solito rispondono entro 1 giorno
-
Move the spring-cloud-commons version and BOM import from the bus parent to the stream parentForse già presa @olegz l’ha presa oggi. Apertatask
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
spring-cloud/spring-cloud-stream#3355 ·
I maintainer di solito rispondono entro 1 giorno
-
area:cpan-port area:performance bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fglock/PerlOnJava#2230 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100