void deactivation(Runnable deactivation) {
                Instant start = clock.instant();
                boolean failed = false;
                metric.add(DEACTIVATION, 1, context);
                logger.log(INFO, "Deactivating singleton for ID: " + id);
                try {
                    deactivation.run();
                }
                catch (RuntimeException e) {
                    failed = true;
                    throw e;
                }
                finally {
                    long durationMillis = Duration.between(start, clock.instant()).toMillis();
                    metric.set(DEACTIVATION_MILLIS, durationMillis, context);
                    logger.log(INFO, "Deactivation completed " + (failed ? "un" : "") +
                                     "successfully in %.3f seconds".formatted(durationMillis * 1e-3));
                    if (failed) metric.add(DEACTIVATION_FAILURES, 1, context);
                    isActive = false;
                    ping();
                }
            }
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