[ 
https://issues.apache.org/jira/browse/GEODE-8435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17180679#comment-17180679
 ] 

ASF GitHub Bot commented on GEODE-8435:
---------------------------------------

jinmeiliao commented on a change in pull request #5462:
URL: https://github.com/apache/geode/pull/5462#discussion_r473186241



##########
File path: 
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/ConnectCommand.java
##########
@@ -168,26 +168,30 @@ public ResultModel connect(
       return result;
     }
 
-    // since 1.14, only allow gfsh to connect to cluster that's older than 1.10
     String remoteVersion = null;
-    String gfshVersion = gfsh.getVersion();
+    String remoteGeodeSerializationVersion = null;
     try {
       remoteVersion = invoker.getRemoteVersion();
-      int minorVersion = Integer.parseInt(versionComponent(remoteVersion, 
VERSION_MINOR));
-      if (versionComponent(remoteVersion, VERSION_MAJOR).equals("1") && 
minorVersion >= 10 ||
-          versionComponent(remoteVersion, VERSION_MAJOR).equals("9") && 
minorVersion >= 9) {
-        InfoResultModel versionInfo = result.addInfo("versionInfo");
-        versionInfo.addLine("You are connected to a cluster of version: " + 
remoteVersion);
-        return result;
+      try {
+        remoteGeodeSerializationVersion = 
invoker.getRemoteGeodeSerializationVersion();

Review comment:
       Can you put these two remote call in the same try block, this "try" 
inside "try" seems confusing:
   
   ```
   try {
         // serialization version is  introduced later than remoteVersion, have 
to call them in the right order
         remoteVersion = invoker.getRemoteVersion();
         remoteSerializationVersion = 
invoker.getRemoteGeodeSerializationVersion();
       }
       catch (Exception ex) {
         // if unable to get the remote version, we are certainly talking to a 
pre-1.5 cluster
         // if unable to get the remote serilization version, we are certainly 
talking to a pre-1.12 cluster
         gfsh.logInfo("failed to get the the remote version.", ex);
       }
   ```




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


> restore gfsh ability to connect if serialization versions match regardless of 
> product version
> ---------------------------------------------------------------------------------------------
>
>                 Key: GEODE-8435
>                 URL: https://issues.apache.org/jira/browse/GEODE-8435
>             Project: Geode
>          Issue Type: Bug
>          Components: gfsh
>            Reporter: Owen Nichols
>            Assignee: Owen Nichols
>            Priority: Major
>              Labels: pull-request-available
>
> This used to work but was broken recently by changes for GEODE-8331.  
> Although this does not impact Geode releases, it causes quite a headache for 
> developers that don't typically pass a product version in their gradle build 
> command.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to