[ https://issues.apache.org/jira/browse/GEODE-8578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17209180#comment-17209180 ]
ASF GitHub Bot commented on GEODE-8578: --------------------------------------- alb3rtobr commented on a change in pull request #669: URL: https://github.com/apache/geode-native/pull/669#discussion_r500610925 ########## File path: tools/gnmsg/server_messages.py ########## @@ -36,16 +36,20 @@ def read_bucket_count(message_bytes, offset): def read_partition_attributes(properties, message_bytes, offset): - if properties["Parts"] != 2 and properties["Parts"] != 4: - raise Exception( - "Don't know how to parse a RESPONSE_CLIENT_PARTITION_ATTRIBUTES message with " - + properties["Parts"] - + " parts (should have 2 or 4 only)." - ) - (properties["BucketCount"], offset) = read_bucket_count(message_bytes, offset) (properties["ColocatedWith"], offset) = parse_key_or_value(message_bytes, offset) - # TODO: parse parts 3 and 4 (partition resolver and list of partition attributes), if they exist + if properties["Parts"] == 4: + (properties["PartitionResolverName"], offset) = parse_key_or_value(message_bytes, offset) + # TODO: parse part 4 (list of partition attributes) + elif properties["Parts"] == 3: + try: + (properties["PartitionResolverName"], offset) = parse_key_or_value(message_bytes, offset) + except: + raise Exception( + "Don't know how to parse a RESPONSE_CLIENT_PARTITION_ATTRIBUTES message with " + + "3 parts and fpa attribute." + ) + # TODO: parse part 3 if it is not partition resolver but list of partition attributes Review comment: > Is it possible for the server to send this message with 3 parts? It seems so. In my example, I got this exception: `Exception: Don't know how to parse a RESPONSE_CLIENT_PARTITION_ATTRIBUTES message with 3 parts (should have 2 or 4 only).` Well, actually what I got first was a `TypeError: must be str, not int` exception because `properties["Parts"]` is not a string: ``` raise Exception( "Don't know how to parse a RESPONSE_CLIENT_PARTITION_ATTRIBUTES message with " + properties["Parts"] + " parts (should have 2 or 4 only)." ) ``` ---------------------------------------------------------------- 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: us...@infra.apache.org > Parse PartitionResolverName in RESPONSE_CLIENT_PARTITION_ATTRIBUTES > ------------------------------------------------------------------- > > Key: GEODE-8578 > URL: https://issues.apache.org/jira/browse/GEODE-8578 > Project: Geode > Issue Type: Improvement > Components: native client > Reporter: Alberto Bustamante Reyes > Assignee: Alberto Bustamante Reyes > Priority: Major > Labels: pull-request-available > > I tried the gnmsg tool with a client file connecting to a cluster that > contains a partition region with a partition resolver, which caused an > exception in the tool. -- This message was sent by Atlassian Jira (v8.3.4#803005)