Skip to content

Commit

Permalink
Core: Fix NPE when calling InMemoryLockManager#release using Hadoop c…
Browse files Browse the repository at this point in the history
…atalog (#8494)
  • Loading branch information
wangtaohz authored Oct 30, 2023
1 parent 8bb52bc commit 64e2deb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/java/org/apache/iceberg/util/LockManagers.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iceberg.util;

import java.util.Map;
import java.util.Optional;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
Expand Down Expand Up @@ -253,7 +254,7 @@ public boolean release(String entityId, String ownerId) {
return false;
}

HEARTBEATS.remove(entityId).cancel(false);
Optional.ofNullable(HEARTBEATS.remove(entityId)).ifPresent(future -> future.cancel(false));
LOCKS.remove(entityId);
return true;
}
Expand Down

0 comments on commit 64e2deb

Please sign in to comment.