You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/03/11 20:40:10 UTC

[GitHub] [geode] agingade commented on a change in pull request #7416: GEODE-10097: Avoid Thread.sleep for reauthentication in MessageDispatcher

agingade commented on a change in pull request #7416:
URL: https://github.com/apache/geode/pull/7416#discussion_r825078063



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageDispatcher.java
##########
@@ -432,34 +442,37 @@ protected void runDispatcher() {
           _messageQueue.remove();
           clientMessage = null;
         } catch (AuthenticationExpiredException expired) {
-          if (waitForReAuthenticationStartTime == -1) {
-            waitForReAuthenticationStartTime = System.currentTimeMillis();
-            // only send the message to clients who can handle the message
-            if (getProxy().getVersion().isNewerThanOrEqualTo(RE_AUTHENTICATION_START_VERSION)) {
-              EventID eventId = createEventId();
-              sendMessageDirectly(new ClientReAuthenticateMessage(eventId));
+          waitForReAuthenticationStartTime = System.currentTimeMillis();
+          long waitFinishTime = waitForReAuthenticationStartTime + reAuthenticateWaitTime;
+          // only send the message to clients who can handle the message
+          if (getProxy().getVersion().isNewerThanOrEqualTo(RE_AUTHENTICATION_START_VERSION)) {
+            EventID eventId = createEventId();
+            sendMessageDirectly(new ClientReAuthenticateMessage(eventId));

Review comment:
       sendMessageDirectly may be time consuming...Is it a good idea to calculate waitFinishTime after sending the message.

##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageDispatcher.java
##########
@@ -193,6 +194,15 @@ public boolean isWaitingForReAuthentication() {
     return waitForReAuthenticationStartTime > 0;
   }
 
+  private boolean subjectUpdated = false;

Review comment:
       need to be volatile? looks like multiple thread could be accessing this. 




-- 
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: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org