symat commented on issue #1300: ZOOKEEPER-3769: handling malformed Leader Election notification messages URL: https://github.com/apache/zookeeper/pull/1300#issuecomment-605872079 well, the parsing logic is not trivial. I was also reading it for some time. There are multiple message versions kept for backward-compatibility / rolling-upgrade support reasons. The older versions differ only in length, but later a proper 'version number' was introduced during the dynamic-reconfig modifications. I actually was convinced for some time that the logic is wrong (around the 36 vs 40 bits long message parsing), but then I think I understood it finally. Not a very nice code... I am not sure if we want to change the quorum-internal protocols in ZooKeeper 4.0, but I think it would make sense to write a new Leader Election class that is using extendable message protocol that handles versions properly. Anyway, I haven't touched the logic itself, only added extra exception handling and a check before allocating memory for the buffer where the configuration string gets copied.
---------------------------------------------------------------- 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] With regards, Apache Git Services
