Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,7 @@ protected void doCommit(TableMetadata base, TableMetadata metadata) {
throw new RuntimeException("Interrupted during commit", e);

} finally {
cleanupMetadataAndUnlock(commitStatus, newMetadataLocation, lockId);
tableLevelMutex.unlock();
cleanupMetadataAndUnlock(commitStatus, newMetadataLocation, lockId, tableLevelMutex);
}
}

Expand Down Expand Up @@ -471,7 +470,8 @@ long acquireLock() throws UnknownHostException, TException, InterruptedException
return lockId;
}

private void cleanupMetadataAndUnlock(CommitStatus commitStatus, String metadataLocation, Optional<Long> lockId) {
private void cleanupMetadataAndUnlock(CommitStatus commitStatus, String metadataLocation, Optional<Long> lockId,
ReentrantLock tableLevelMutex) {
try {
if (commitStatus == CommitStatus.FAILURE) {
// If we are sure the commit failed, clean up the uncommitted metadata file
Expand All @@ -482,6 +482,7 @@ private void cleanupMetadataAndUnlock(CommitStatus commitStatus, String metadata
throw e;
} finally {
unlock(lockId);
tableLevelMutex.unlock();
}
}

Expand Down