boolean release(final ClusterLockKey clusterLockKey) {
        if (!securityContext.isProcessingUser()) {
            throw new PermissionException(securityContext.getUserRef(),
                    "Only the processing user is allowed to release a cluster lock");
        }

        boolean success = false;

        try {
            final String lockName = clusterLockKey.getName();
            final Lock currentLock = lockMap.get(lockName);
            // We should know about a lock that a node is trying to release. If
            // we don't then we must have removed it in unlockOld() which should
            // not happen if the node that holds the lock has been able to keep
            // the lock alive.
            if (currentLock != null) {
                // Make sure the node trying to release the lock is the node
                // that we think actually holds it. If unlockOld() has
                // previously removed the lock and so allowed another node to
                // obtain the lock then we should not allow the previous owner
                // to release it.
                if (currentLock.clusterLockKey.equals(clusterLockKey)) {
                    success = lockMap.remove(lockName, currentLock);
                } else {
                    error("unlock() - Attempt to unlock with a different key to the owner", clusterLockKey,
                            currentLock);
                }
            } else {
                error("unlock() - Attempt to unlock when was not locked", clusterLockKey, currentLock);
            }

            debug("unlock()", clusterLockKey, currentLock, success);
        } catch (final RuntimeException e) {
            LOGGER.error(e.getMessage(), e);
        }

        return success;
    }
Try and release a lock with the supplied key.

@param clusterLockKey The key to try and release an associated lock with.
@return Return true if we managed to release a lock with the supplied
key, return false if no lock could be found for this key or if
the lock is owned by another node/process.
stroom-cluster/stroom-cluster-lock-impl-db/src/main/java/stroom/cluster/lock/impl/db/ClusterLockClusterHandler.java