droudnitsky commented on code in PR #7389:
URL: https://github.com/apache/hbase/pull/7389#discussion_r2436399582


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java:
##########
@@ -519,6 +520,7 @@ public Pair<Message, ExtendedCellScanner> call(RpcCall 
call, MonitoredRPCHandler
       // increment the number of requests that were exceptions.
       metrics.exception(e);
 
+      if (e instanceof DoNotRetryRuntimeException) throw new 
DoNotRetryIOException(e);

Review Comment:
   Thank you Duo for the response, the exception happens in `compareTo` method 
from `Comparable` interface that doesn't allow for a checked exception, so yes 
you are correct its not possible to throw a checked exception directly.
   
   One option I was considering , was instead of adding a generic  
`DoNotRetryRuntimeException` that is wrapped in `DoNotRetryIOException` in the  
`RpcServer` layer, is to try to do this catching/conversion to checked 
exception in a deeper layer closer to where the comparator is applied, but I 
did not find a clean place or a clean way to do this, so I think adding a 
generic `DoNotRetryRuntimeException` is the best/most maintainable way, and I 
am thinking it can be reused in other places if needed where its not possible 
to throw a checked exception but we need to be able to bubble a 
`DoNotRetryIOException` to the client. 



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

Reply via email to