jiajunwang commented on a change in pull request #642: Fix handleNewSession 
creating ephemeral node with expired session
URL: https://github.com/apache/helix/pull/642#discussion_r364004590
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixManager.java
 ##########
 @@ -1134,9 +1159,31 @@ public void handleNewSession(final String sessionId) 
throws Exception {
     // Wait until we get a non-zero session id. Otherwise, getSessionId() 
might be null.
     waitUntilConnected();
 
-    // TODO: filter out stale sessions here.
+    /*
+     * Filter out stale sessions. If a session id is not null and not the same 
as current session
+     * id, this session is expired. With this filtering, expired sessions are 
NOT handled,
+     * so performance is expected to improve.
+     */
+    if (sessionId != null && !getSessionId().equals(sessionId)) {
+      LOG.info("Session is expired and not handled. Expected: {}. Actual: 
{}.", sessionId,
 
 Review comment:
   nit, LOG.warn

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to