private void renewLease() {
            // Witness value to detect if invalidation occurs between here and successful ping.
            Instant ourDoom = doom.get();
            if (ourDoom == INVALID) {
                logger.log(INFO, "Lease invalidated");
                return; // Skip to updateStatus, deactivation, and release the lock.
            }
            Instant start = clock.instant();
            if (lock == null) try {
                lock = curator.lock(path.append("lock"), tickTimeout);
                logger.log(INFO, "Acquired lock for ID: " + id);
            }
            catch (UncheckedTimeoutException e) {
                logger.log(FINE, e, () -> "Timed out acquiring lock for '" + path + "' within " + tickTimeout);
                cleanOrphans();
                return;
            }
            catch (RuntimeException e) {
                logger.log(WARNING, e, () -> "Failed acquiring lock for '" + path + "' within " + tickTimeout);
                cleanOrphans();
                return;
            }
            try {
                curator.set(path.append("ping"), new byte[0]);
            }
            catch (RuntimeException e) {
                logger.log(FINE, "Failed pinging ZK cluster", e);
                return;
            }
            if ( ! doom.compareAndSet(ourDoom, start.plus(curator.sessionTimeout().multipliedBy(9).dividedBy(10)))) {
                logger.log(INFO, "Deadline changed from " + ourDoom + " to " + doom.get() + "; current lease renewal is void");
            }
        }
Attempt to acquire the lock, if not held.
If lock is held, or acquired, ping the ZK cluster to extend our deadline.
zkfacade/src/main/java/com/yahoo/vespa/curator/SingletonManager.java