private void updateStatus() {
            boolean shouldBeActive = doom.get().isAfter(clock.instant());
            if ( ! active && shouldBeActive) {
                try {
                    active = true;
                    if ( ! singletons.isEmpty()) metrics.activation(singletons.peek()::activate);
                }
                catch (RuntimeException e) {
                    logger.log(WARNING, "Failed to activate " + singletons.peek() + ", deactivating again", e);
                    shouldBeActive = false;
                }
            }
            if ( ! shouldBeActive) {
                logger.log(FINE, () -> "Doom value is " + doom.get());
                if (active) {
                    try {
                        if ( ! singletons.isEmpty()) metrics.deactivation(singletons.peek()::deactivate);
                        active = false;
                    }
                    catch (RuntimeException e) {
                        logger.log(WARNING, "Failed to deactivate " + singletons.peek(), e);
                    }
                }
                unlock();
            }
        }
Attempt to activate or deactivate if status has changed.
If activation fails, we release the lock, so a different container may acquire it.
zkfacade/src/main/java/com/yahoo/vespa/curator/SingletonManager.java