Skip to content

Commit

Permalink
Add additional logging in startup lock code (#557)
Browse files Browse the repository at this point in the history
* Add DEBUG logging in StartupLockBundle that contains the lock path,
state of the LockInfo, and message from LockInfo.
* Add INFO level logging in StartupLocker explaining when a lock was not
attempted b/c no Zookeeper servers were available.
  • Loading branch information
sleberknight authored Oct 22, 2024
1 parent 0e95aec commit a1074e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public void run(C configuration, Environment environment) throws Exception {
startupLockConfig.getCuratorConfig(),
environment);

LOG.debug("For lock {}, state is {} ({})", lockPath, lockInfo.getLockState(), lockInfo.getInfoMessage());

LOG.trace("Add fallback startup listener");
startupLocker.addFallbackJettyStartupLifeCycleListener(lockInfo, environment);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public StartupLockInfo acquireStartupLock(String lockPath,
}
}

LOG.info("Lock was not attempted because no ZooKeeper servers were available for connect string: {}",
curatorConfig.getZkConnectString());
return StartupLockInfo.builder()
.lockState(StartupLockInfo.LockState.NOT_ATTEMPTED)
.infoMessage(format("No ZooKeepers are available from connect string [{}]", curatorConfig.getZkConnectString()))
Expand Down

0 comments on commit a1074e2

Please sign in to comment.