pan3793 commented on code in PR #8688:
URL: https://github.com/apache/hadoop/pull/8688#discussion_r4535453202
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java:
##########
@@ -290,8 +318,13 @@ public void startThreads() throws IOException {
try {
keyCache = CuratorCache.bridgeBuilder(zkClient, ZK_DTSM_MASTER_KEY_ROOT)
.build();
+ CountDownLatch keyCacheInitialized = new CountDownLatch(1);
CuratorCacheListener keyCacheListener = CuratorCacheListener.builder()
.forCreatesAndChanges((oldNode, node) -> {
+ if (ZK_DTSM_MASTER_KEY_ROOT.equals(node.getPath())) {
Review Comment:
Added `testRootPayloadNotParsed` in 1288c98, based on your snippet.
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java:
##########
@@ -96,6 +98,10 @@ public abstract class
ZKDelegationTokenSecretManager<TokenIdent extends Abstract
public static final String ZK_DTSM_TOKEN_WATCHER_ENABLED = ZK_CONF_PREFIX
+ "token.watcher.enabled";
public static final boolean ZK_DTSM_TOKEN_WATCHER_ENABLED_DEFAULT = true;
+ /** Bound on the wait for the initial cache load; 0 waits indefinitely. */
Review Comment:
Done in 1288c98: the Javadoc says per cache, and the constructor rejects
negative values (`testNegativeCacheInitTimeoutRejected`).
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java:
##########
@@ -290,8 +318,13 @@ public void startThreads() throws IOException {
try {
keyCache = CuratorCache.bridgeBuilder(zkClient, ZK_DTSM_MASTER_KEY_ROOT)
.build();
+ CountDownLatch keyCacheInitialized = new CountDownLatch(1);
CuratorCacheListener keyCacheListener = CuratorCacheListener.builder()
.forCreatesAndChanges((oldNode, node) -> {
+ if (ZK_DTSM_MASTER_KEY_ROOT.equals(node.getPath())) {
+ // The root node itself is a container, not a key.
+ return;
+ }
try {
processKeyAddOrUpdate(node.getData());
Review Comment:
Done in 1288c98: the three listener error logs include the znode path.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]