Skip to content

Commit aebac6d

Browse files
Gopal Vsteveloughran
authored andcommitted
HADOOP-16461. Regression: FileSystem cache lock parses XML within the lock.
Contributed by Gopal V. Change-Id: If6654f850e9c24ee0d9519a46fd6269b18e1a7a4
1 parent 0753031 commit aebac6d

File tree

1 file changed

+6
-1
lines changed
  • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs

1 file changed

+6
-1
lines changed

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3385,6 +3385,9 @@ private FileSystem getInternal(URI uri, Configuration conf, Key key)
33853385
}
33863386

33873387
fs = createFileSystem(uri, conf);
3388+
final long timeout = conf.getTimeDuration(SERVICE_SHUTDOWN_TIMEOUT,
3389+
SERVICE_SHUTDOWN_TIMEOUT_DEFAULT,
3390+
ShutdownHookManager.TIME_UNIT_DEFAULT);
33883391
synchronized (this) { // refetch the lock again
33893392
FileSystem oldfs = map.get(key);
33903393
if (oldfs != null) { // a file system is created while lock is releasing
@@ -3395,7 +3398,9 @@ private FileSystem getInternal(URI uri, Configuration conf, Key key)
33953398
// now insert the new file system into the map
33963399
if (map.isEmpty()
33973400
&& !ShutdownHookManager.get().isShutdownInProgress()) {
3398-
ShutdownHookManager.get().addShutdownHook(clientFinalizer, SHUTDOWN_HOOK_PRIORITY);
3401+
ShutdownHookManager.get().addShutdownHook(clientFinalizer,
3402+
SHUTDOWN_HOOK_PRIORITY, timeout,
3403+
ShutdownHookManager.TIME_UNIT_DEFAULT);
33993404
}
34003405
fs.key = key;
34013406
map.put(key, fs);

0 commit comments

Comments
 (0)