anmolanmol1234 commented on code in PR #7364:
URL: https://github.com/apache/hadoop/pull/7364#discussion_r1957990905
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsDfsClient.java:
##########
@@ -402,11 +406,32 @@ public AbfsRestOperation createPath(final String path,
if (!op.hasResult()) {
throw ex;
}
- if (!isFile && op.getResult().getStatusCode() ==
HttpURLConnection.HTTP_CONFLICT) {
- String existingResource =
- op.getResult().getResponseHeader(X_MS_EXISTING_RESOURCE_TYPE);
- if (existingResource != null && existingResource.equals(DIRECTORY)) {
- return op; //don't throw ex on mkdirs for existing directory
+ if (!isFile) {
+ if (op.getResult().getStatusCode() == HttpURLConnection.HTTP_CONFLICT)
{
+ String existingResource =
+ op.getResult().getResponseHeader(X_MS_EXISTING_RESOURCE_TYPE);
+ if (existingResource != null && existingResource.equals(DIRECTORY)) {
+ return op; //don't throw ex on mkdirs for existing directory
+ }
+ }
+ } else {
+ // recovery using client transaction id only if it is a retried
request.
+ if (op.isARetriedRequest() && clientTransactionId != null
+ && (op.getResult().getStatusCode() ==
HttpURLConnection.HTTP_CONFLICT
+ || op.getResult().getStatusCode() ==
HttpURLConnection.HTTP_PRECON_FAILED)) {
+ try {
+ final AbfsHttpOperation getPathStatusOp =
+ getPathStatus(path, false,
+ tracingContext, null).getResult();
+ if (clientTransactionId.equals(
+ getPathStatusOp.getResponseHeader(
+ X_MS_CLIENT_TRANSACTION_ID))) {
+ return op;
+ }
+ } catch (AzureBlobFileSystemException ignored) {
+ // In case of get path status failure,
Review Comment:
we are ignoring and not throwing the exception right ?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]