oxia-java
oxia-java copied to clipboard
ThreadSimpleLock acquire lock becomes slower as time goes one
Motivation
String lock = buildLockKey(topic);
AsyncLock threadSimpleLock = lockManager.getThreadSimpleLock(lock);
long now = System.nanoTime();
try {
threadSimpleLock.lock().get();
compactionMetrics.getAcquireCommitLockLatency().recordSuccess(System.nanoTime() - now);
} catch (InterruptedException | ExecutionException e) {
log.error("Failed to lock the lakehouse commit lock {}", lock, e);
compactionMetrics.getAcquireCommitLockLatency().recordFailure(System.nanoTime() - now);
throw new CompactionException("Failed to lock the lakehouse commit lock " + lock, e);
}
When using threadSimpleLock to get lock, it becomes slow as time goes on