sodonnel commented on pull request #3231:
URL: https://github.com/apache/ozone/pull/3231#issuecomment-1077756058


   >  The server-side change is needed for existing clients already out there.
   
   Ah, of course. Had the de-serialize code correctly handled unknown String -> 
ENum conversions, we could have added the new ports without issue, correct?
   
   This makes me think that anywhere in the code were we take proto value and 
convert it to an enum, we need to handle an "unknown enum" type of condition. I 
doubt there is an easy way to find this sort of code. It really is a bug 
"waiting to happen" to take a String from an serialized message and put it 
straight into an enum without a catch for `IllegalArgumentException`. This is 
probably something we should make the wider team aware of and watch out for in 
reviews, and ensure there are unit tests for etc.
   
   I would not like to see a lot of usage of these CLIENT VERSIONS and less 
careful use of protobuf changes. Is the only place this is used right now to 
handle this port issue? I guess we only have the one version defined in 
`VERSION_HANDLES_UNKNOWN_DN_PORTS`.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to