slfan1989 commented on code in PR #8681:
URL: https://github.com/apache/hadoop/pull/8681#discussion_r3788207131


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/subcluster/TestMockRouter.java:
##########
@@ -85,6 +99,19 @@ public static void main(String[] args) throws YarnException {
         FederationStateStore.class, retryPolicy);
     stateStore.init(conf);
     FederationStateStoreFacade.getInstance().reinitialize(stateStore, conf);
+

Review Comment:
   By the time execution reaches this point, `router.start()` has already 
started `RouterClientRMService`. Its delegation-token secret manager calls 
`FederationStateStoreFacade.getInstance(conf)`, which creates and initializes a 
state store.
   
   These lines then create a second store and `reinitialize()` replaces the 
facade's reference without closing the first one. The new shutdown hook only 
closes the second store, so the original ZooKeeper client is still left to 
process termination. This means the Router does not yet shut down all of its 
state-store resources cleanly.
   
   Could we reuse 
`FederationStateStoreFacade.getInstance(conf).getStateStore()` and register the 
close hook for that store, removing the second creation/reinitialization? 
Alternatively, the original store needs to be explicitly closed before it is 
replaced.



-- 
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]

Reply via email to