private void unlock(String id, long owner) {
        boolean ok = tryUnlock(id, owner);
        if (!ok) {
            log.error("Lock service failed to unlock: {}", id);
        } else {
            log.debug("Thread {} releases a lock to the resource {} with owner {}", Thread.currentThread().getName(), id, owner);
        }
    }
Simple spin-lock implementation which works with Redis as cache. Supports volatile-* eviction policies.
storage/src/main/java/com/epam/aidial/core/storage/service/LockService.java