HADOOP-11523. StorageException complaining " no lease ID" when updating FolderLastModifiedTime in WASB. Contributed by Duo Xu.
(cherry picked from commit f2c91098c4
)
This commit is contained in:
parent
e8d154baea
commit
4607ca2854
|
@ -441,6 +441,9 @@ Release 2.7.0 - UNRELEASED
|
|||
HADOOP-11403. Avoid using sys_errlist on Solaris, which lacks support for it
|
||||
(Malcolm Kavalsky via Colin P. McCabe)
|
||||
|
||||
HADOOP-11523. StorageException complaining " no lease ID" when updating
|
||||
FolderLastModifiedTime in WASB. (Duo Xu via cnauroth)
|
||||
|
||||
Release 2.6.1 - UNRELEASED
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
|
|
@ -2040,7 +2040,37 @@ public class NativeAzureFileSystem extends FileSystem {
|
|||
createPermissionStatus(FsPermission.getDefault()));
|
||||
}
|
||||
|
||||
store.updateFolderLastModifiedTime(parentKey, null);
|
||||
if (store.isAtomicRenameKey(parentKey)) {
|
||||
SelfRenewingLease lease = null;
|
||||
try {
|
||||
lease = leaseSourceFolder(parentKey);
|
||||
store.updateFolderLastModifiedTime(parentKey, lease);
|
||||
} catch (AzureException e) {
|
||||
String errorCode = "";
|
||||
try {
|
||||
StorageException e2 = (StorageException) e.getCause();
|
||||
errorCode = e2.getErrorCode();
|
||||
} catch (Exception e3) {
|
||||
// do nothing if cast fails
|
||||
}
|
||||
if (errorCode.equals("BlobNotFound")) {
|
||||
throw new FileNotFoundException("Folder does not exist: " + parentKey);
|
||||
}
|
||||
LOG.warn("Got unexpected exception trying to get lease on "
|
||||
+ parentKey + ". " + e.getMessage());
|
||||
throw e;
|
||||
} finally {
|
||||
try {
|
||||
if (lease != null) {
|
||||
lease.free();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.error("Unable to free lease on " + parentKey, e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
store.updateFolderLastModifiedTime(parentKey, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue