HDFS-16235. Fix Deadlock in LeaseRenewer for static remove method (#3472)

(cherry picked from commit 5f9321a5d4112e7b4ee9e6b948ce46a2b152a2db)
(cherry picked from commit 1df3b3de463332b688299078a59265ce405af6ac)
This commit is contained in:
AngersZhuuuu 2021-09-25 18:17:44 +08:00 committed by He Xiaoqiao
parent 1d9a6ffae5
commit 2bd78b7eaa
No known key found for this signature in database
GPG Key ID: A80CC124E9A0FA63

View File

@ -96,7 +96,9 @@ public static LeaseRenewer getInstance(final String authority,
* @param renewer Instance to be cleared from Factory
*/
public static void remove(LeaseRenewer renewer) {
Factory.INSTANCE.remove(renewer);
synchronized (renewer) {
Factory.INSTANCE.remove(renewer);
}
}
/**