oxia-java icon indicating copy to clipboard operation
oxia-java copied to clipboard

ThreadSimpleLock acquire lock becomes slower as time goes one

Open hangc0276 opened this issue 1 year ago • 0 comments

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 image

hangc0276 avatar Sep 20 '24 04:09 hangc0276