huaxiangsun commented on a change in pull request #2584:
URL: https://github.com/apache/hbase/pull/2584#discussion_r514580314



##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java
##########
@@ -182,8 +183,20 @@ public void newDead(ServerName sn) {
   }
 
   private void spawnRenewalChore(final UserGroupInformation user) {
-    authService = new ChoreService("Relogin service");
-    authService.scheduleChore(AuthUtil.getAuthRenewalChore(user));
+    ChoreService service = getChoreService();
+    service.scheduleChore(AuthUtil.getAuthRenewalChore(user));
+  }
+
+  /**
+   * If choreService has not been created yet, create the ChoreService.
+   * It is not thread safe.
+   * @return ChoreService
+   */
+  ChoreService getChoreService() {

Review comment:
       Yeah, it is only called in the context of constructor. To start the 
service in the constructor, it needs to check if meta replica load balancer is 
enabled. Duo has a comment to avoid checking multiple configs in 
AsyncConnectionImpl and start the service on demand. Tough there is no 
multithread requirement for now, I think it makes sense to add synchronized. 




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to