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
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu với các lớp request bị ảnh hưởng được liệt kê trong issue và com.oracle.bmc.objectstorage.transfer.UploadManager, sau đó kiểm tra cách xử lý RetryConfiguration và thay đổi được báo cáo trong phiên bản 3.31.1. Xác minh rằng các retry của việc upload stream được đặt lại đúng cách khi không có cấu hình ở cấp request, đồng thời các workaround được ghi lại phù hợp với hành vi hiện tại của SDK.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 243
- Fork
- 171
- Merge trung bình
- 5 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của oracle/oci-java-sdk
-
NoSuchMethodError in the circuit breaker since 3.103.0 when resilience4j 2.x is on the classpathĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 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)Đang mởSDK
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 20/100
oracle/oci-java-sdk#788 ·
-
Identity Domains
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
oracle/oci-java-sdk#764 · 3 bình luận ·
-
SDK
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
oracle/oci-java-sdk#726 · 1 bình luận ·
-
Object Storage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
oracle/oci-java-sdk#723 · 1 reaction ·
Tất cả issue của oracle/oci-java-sdk
Issue tương tự
-
enhancement infra
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
5.0.x backport bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
spring-cloud/spring-cloud-function#1569 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Move the spring-cloud-commons version and BOM import from the bus parent to the stream parentCó thể đã có người làm @olegz đã nhận hôm nay. Đang mởtask
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
spring-cloud/spring-cloud-stream#3355 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:cpan-port area:performance bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fglock/PerlOnJava#2230 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100