Skip to content

Commit 829a9bd

Browse files
committed
backmerged branch-3.3:: b75ced1
2 parents 08219d2 + b75ced1 commit 829a9bd

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/contracts/exceptions/InvalidAbfsRestOperationException.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
import org.apache.hadoop.fs.azurebfs.contracts.services.AzureServiceErrorCode;
2525

2626
/**
27-
* Exception to wrap invalid Azure service error responses.
27+
* Exception to wrap invalid Azure service error responses and exceptions
28+
* raised on network IO.
2829
*/
2930
@InterfaceAudience.Public
3031
@InterfaceStability.Evolving
@@ -34,7 +35,9 @@ public InvalidAbfsRestOperationException(
3435
super(
3536
AzureServiceErrorCode.UNKNOWN.getStatusCode(),
3637
AzureServiceErrorCode.UNKNOWN.getErrorCode(),
37-
"InvalidAbfsRestOperationException",
38+
innerException != null
39+
? innerException.toString()
40+
: "InvalidAbfsRestOperationException",
3841
innerException);
3942
}
4043
}

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsHttpOperation.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,9 @@ public void processResponse(final byte[] buffer, final int offset, final int len
409409
}
410410
}
411411
} catch (IOException ex) {
412-
LOG.error("UnexpectedError: ", ex);
412+
LOG.warn("IO/Network error: {} {}: {}",
413+
method, getMaskedUrl(), ex.getMessage());
414+
LOG.debug("IO Error: ", ex);
413415
throw ex;
414416
} finally {
415417
if (this.isTraceEnabled) {

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsRestOperation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ private boolean executeHttpOperation(final int retryCount,
324324
return false;
325325
} catch (IOException ex) {
326326
if (LOG.isDebugEnabled()) {
327-
LOG.debug("HttpRequestFailure: {}, {}", httpOperation.toString(), ex);
327+
LOG.debug("HttpRequestFailure: {}, {}", httpOperation, ex);
328328
}
329329

330330
failureReason = RetryReason.getAbbreviation(ex, -1, "");
@@ -338,7 +338,7 @@ private boolean executeHttpOperation(final int retryCount,
338338
intercept.updateMetrics(operationType, httpOperation);
339339
}
340340

341-
LOG.debug("HttpRequest: {}: {}", operationType, httpOperation.toString());
341+
LOG.debug("HttpRequest: {}: {}", operationType, httpOperation);
342342

343343
if (client.getRetryPolicy().shouldRetry(retryCount, httpOperation.getStatusCode())) {
344344
int status = httpOperation.getStatusCode();

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/ReadBufferManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,8 @@ ReadBuffer getNextBlockToRead() throws InterruptedException {
455455
*/
456456
void doneReading(final ReadBuffer buffer, final ReadBufferStatus result, final int bytesActuallyRead) {
457457
if (LOGGER.isTraceEnabled()) {
458-
LOGGER.trace("ReadBufferWorker completed file {} for offset {} bytes {}",
459-
buffer.getStream().getPath(), buffer.getOffset(), bytesActuallyRead);
458+
LOGGER.trace("ReadBufferWorker completed read file {} for offset {} outcome {} bytes {}",
459+
buffer.getStream().getPath(), buffer.getOffset(), result, bytesActuallyRead);
460460
}
461461
synchronized (this) {
462462
// If this buffer has already been purged during

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/ReadBufferWorker.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.io.IOException;
2222
import java.util.concurrent.CountDownLatch;
2323

24+
import org.apache.hadoop.fs.PathIOException;
2425
import org.apache.hadoop.fs.azurebfs.contracts.services.ReadBufferStatus;
2526

2627
class ReadBufferWorker implements Runnable {
@@ -73,8 +74,11 @@ public void run() {
7374
buffer.getTracingContext());
7475

7576
bufferManager.doneReading(buffer, ReadBufferStatus.AVAILABLE, bytesRead); // post result back to ReadBufferManager
77+
} catch (IOException ex) {
78+
buffer.setErrException(ex);
79+
bufferManager.doneReading(buffer, ReadBufferStatus.READ_FAILED, 0);
7680
} catch (Exception ex) {
77-
buffer.setErrException(new IOException(ex));
81+
buffer.setErrException(new PathIOException(buffer.getStream().getPath(), ex));
7882
bufferManager.doneReading(buffer, ReadBufferStatus.READ_FAILED, 0);
7983
}
8084
}

0 commit comments

Comments
 (0)