saxenapranav commented on code in PR #6699: URL: https://github.com/apache/hadoop/pull/6699#discussion_r1568796124
########## hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsInputStream.java: ########## @@ -564,11 +669,25 @@ int readRemote(long position, byte[] b, int offset, int length, TracingContext t } catch (AzureBlobFileSystemException ex) { if (ex instanceof AbfsRestOperationException) { AbfsRestOperationException ere = (AbfsRestOperationException) ex; + abfsHttpOperation = ((AbfsRestOperationException) ex).getAbfsHttpOperation(); if (ere.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { throw new FileNotFoundException(ere.getMessage()); } + /* + * Status 416 is sent when read range is out of contentLength range. + * This would happen only in the case if contentLength is not known before + * opening the inputStream. + */ + if (ere.getStatusCode() == READ_PATH_REQUEST_NOT_SATISFIABLE + && !fileStatusInformationPresent.get()) { + return -1; + } } throw new IOException(ex); + } finally { + if (!fileStatusInformationPresent.get() && abfsHttpOperation != null) { + initPathPropertiesFromReadPathResponseHeader(abfsHttpOperation); Review Comment: sure, have refactored to `initPropertiesFromReadResponseHeader`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org