File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
core/sdk-core/src/main/java/software/amazon/awssdk/core/internal/async Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,15 @@ private void handleSubscriptionCancel() {
183183
184184 upstreamResponseTransformer .onResponse (responseT .get ());
185185
186- for (int i = 1 ; i <= buffers .size (); ++i ) {
186+ int totalPartCount = nextPartNumber .get () - 1 ;
187+ if (buffers .size () != totalPartCount ) {
188+ resultFuture .completeExceptionally (
189+ SdkClientException .create (String .format ("Number of parts in buffer [%d] does not match total part count"
190+ + " [%d], some parts did not complete successfully." ,
191+ buffers .size (), totalPartCount )));
192+ return ;
193+ }
194+ for (int i = 1 ; i <= totalPartCount ; ++i ) {
187195 publisherToUpstream .send (buffers .get (i )).exceptionally (ex -> {
188196 resultFuture .completeExceptionally (SdkClientException .create ("unexpected error occurred" , ex ));
189197 return null ;
You can’t perform that action at this time.
0 commit comments