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/04/16 00:24:27 UTC

[GitHub] [geode] jinmeiliao commented on a diff in pull request #7598: GEODE-10243: Fail early if old client auth expires

jinmeiliao commented on code in PR #7598:
URL: https://github.com/apache/geode/pull/7598#discussion_r851562546


##########
geode-old-client-support/src/main/java/com/gemstone/gemfire/OldClientSupportProvider.java:
##########
@@ -121,19 +124,23 @@ public String processOutgoingClassName(String name, DataOutput out) {
   }
 
   @Override
-  public Throwable getThrowable(Throwable theThrowable, KnownVersion clientVersion) {
+  public Throwable getThrowable(Throwable theThrowable, KnownVersion clientVersion,
+      ClientProxyMembershipID clientId) {
 
     if (theThrowable == null) {
       return theThrowable;
     }
 
     // backward compatibility for authentication expiration
-    if (clientVersion.isOlderThan(ClientReAuthenticateMessage.RE_AUTHENTICATION_START_VERSION)) {
-      if (theThrowable instanceof AuthenticationExpiredException) {
-        return new AuthenticationRequiredException(USER_NOT_FOUND);
-      }
-      Throwable cause = theThrowable.getCause();
-      if (cause instanceof AuthenticationExpiredException) {
+    if (clientVersion.isOlderThan(RE_AUTHENTICATION_START_VERSION)) {
+      if (theThrowable instanceof AuthenticationExpiredException
+          || theThrowable.getCause() instanceof AuthenticationExpiredException) {
+        if (CacheClientNotifier.getInstance().getClientProxy(clientId) != null) {
+          // Re-authentication with Server->Client queues is not supported
+          return new IllegalStateException(OLD_CLIENT_AUTHENTICATION_EXPIRED);

Review Comment:
   Will the old client  apps (without any code change) be able to handle this exception?



##########
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageDispatcher.java:
##########
@@ -539,12 +540,17 @@ private boolean handleAuthenticationExpiredException(AuthenticationExpiredExcept
       // flag for the notification to happen.
       waitForReAuthenticationStartTime = System.currentTimeMillis();

Review Comment:
   You want to move these two lines down to after the if (old version) 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-unsubscribe@geode.apache.org

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