Jens-G commented on PR #2953:
URL: https://github.com/apache/thrift/pull/2953#issuecomment-2031943290

   First, essentially your "solution" boils down to
   
   ```
   void TSocket::write(const uint8_t* buf, uint32_t len) {
     try{
         // some code that may throw TTransportException (or something else)
     }
     catch(TTransportException e) {   // catch it
       throw e;                       // re-throw it 
     }
   }
   ```
   
   It's probably me but I don't see the point in this.
   
   Second, whenever you call code, be it your own or 3rd party code, there may 
be errors that you don't expect. You may run out of disk space, memory or run 
into communication timeouts. Your point was that this is to ensure your server 
runs with high availability:
   
   >  clients connect to the server each time by catching exceptions to 
determine if the server is available
   
   I can't see how catching one particular exception at this place will help 
with that. Why can't you catch and handle the exception in the calling code? 
And how does catching and re-throwing help with making the server more 
available? Also, why is it clients that have to perform that task? Assumed you 
use some state-of-the-art system like e.g. kubernetes, [there is special 
handling built right into the platform for exactly this 
task](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
 and therefore no need to re-invent the wheel again.
   
   To me it looks as if you might try to solve the wrong problem, or at least 
at the wrong place.
   


-- 
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: notifications-unsubscr...@thrift.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to