HADOOP-16461. Regression: FileSystem cache lock parses XML within the lock.

Contributed by Gopal V.

Change-Id: If6654f850e9c24ee0d9519a46fd6269b18e1a7a4
This commit is contained in:
Gopal V 2019-07-26 11:32:13 +01:00 committed by Steve Loughran
parent 07530314c2
commit aebac6d2d2
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0

View File

@ -3385,6 +3385,9 @@ private FileSystem getInternal(URI uri, Configuration conf, Key key)
}
fs = createFileSystem(uri, conf);
final long timeout = conf.getTimeDuration(SERVICE_SHUTDOWN_TIMEOUT,
SERVICE_SHUTDOWN_TIMEOUT_DEFAULT,
ShutdownHookManager.TIME_UNIT_DEFAULT);
synchronized (this) { // refetch the lock again
FileSystem oldfs = map.get(key);
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)
// now insert the new file system into the map
if (map.isEmpty()
&& !ShutdownHookManager.get().isShutdownInProgress()) {
ShutdownHookManager.get().addShutdownHook(clientFinalizer, SHUTDOWN_HOOK_PRIORITY);
ShutdownHookManager.get().addShutdownHook(clientFinalizer,
SHUTDOWN_HOOK_PRIORITY, timeout,
ShutdownHookManager.TIME_UNIT_DEFAULT);
}
fs.key = key;
map.put(key, fs);