Skip to content

Commit 50e38ca

Browse files
committed
Undo cancel changes not required for low level client only
1 parent e48a0f6 commit 50e38ca

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

services/s3/src/main/java/software/amazon/awssdk/services/s3/internal/crt/S3CrtResponseHandlerAdapter.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
public final class S3CrtResponseHandlerAdapter implements S3MetaRequestResponseHandler {
5151
private static final Logger log = Logger.loggerFor(S3CrtResponseHandlerAdapter.class);
5252
private static final Duration META_REQUEST_TIMEOUT = Duration.ofSeconds(10);
53-
private static final int CRT_SUCCESSFUL_CANCEL = 14374;
54-
5553
private final CompletableFuture<Void> resultFuture;
5654
private final SdkAsyncHttpResponseHandler responseHandler;
5755

@@ -154,8 +152,6 @@ public int onResponseBody(ByteBuffer bodyBytesIn, long objectRangeStart, long ob
154152
public void onFinished(S3FinishedResponseContext context) {
155153
int crtCode = context.getErrorCode();
156154
log.debug(() -> "Request finished with code: " + crtCode);
157-
initiateResponseHandling(initialHeadersResponse.build());
158-
159155
if (crtCode != CRT.AWS_CRT_SUCCESS) {
160156
handleError(context);
161157
} else {
@@ -186,29 +182,11 @@ private void handleError(S3FinishedResponseContext context) {
186182

187183
if (isServiceError(responseStatus) && errorPayload != null) {
188184
handleServiceError(responseStatus, headers, errorPayload);
189-
} else if (crtCode == CRT_SUCCESSFUL_CANCEL) {
190-
handleSuccessfulCancel(context, crtCode);
191185
} else {
192186
handleIoError(context, crtCode);
193187
}
194188
}
195189

196-
private void handleSuccessfulCancel(S3FinishedResponseContext context, int crtCode) {
197-
if (!responseHandlingInitiated) {
198-
responseHandlingInitiated = true;
199-
responseHandler.onHeaders(initialHeadersResponse.build());
200-
}
201-
202-
Throwable cause = context.getCause();
203-
204-
// TODO: Potentially subclass this exception
205-
SdkClientException sdkClientException =
206-
SdkClientException.create("Failed to send the request: " +
207-
CRT.awsErrorString(crtCode), cause);
208-
failResponseHandlerAndFuture(sdkClientException);
209-
notifyResponsePublisherErrorIfNeeded(sdkClientException);
210-
}
211-
212190
private void handleIoError(S3FinishedResponseContext context, int crtCode) {
213191
Throwable cause = context.getCause();
214192

services/s3/src/main/java/software/amazon/awssdk/services/s3/internal/crt/S3MetaRequestPauseObservable.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,5 @@ public void subscribe(S3MetaRequestWrapper request) {
4545
public ResumeToken pause() {
4646
return pause.apply(request);
4747
}
48-
49-
public void cancel() {
50-
if (request != null) {
51-
request.cancel();
52-
}
53-
}
5448
}
5549

0 commit comments

Comments
 (0)