jinmeiliao commented on a change in pull request #7416: URL: https://github.com/apache/geode/pull/7416#discussion_r820937227
########## File path: geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageDispatcher.java ########## @@ -432,34 +443,32 @@ 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)); - } - // We wait for all versions of clients to re-authenticate. For older clients we still - // wait, just in case client will perform some operations to - // trigger credential refresh on its own. - Thread.sleep(200); - } else { + 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)); + } + // We wait for all versions of clients to re-authenticate. For older clients we still + // wait, just in case client will perform some operations to + // trigger credential refresh on its own. + synchronized (re_auth_lock) { Review comment: You mean we should move the message sending into the synchronized block? -- 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-unsubscr...@geode.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org