langke1988 commented on PR #2953:
URL: https://github.com/apache/thrift/pull/2953#issuecomment-2033380539

   Thank you for your patient explanation. It seems that I was mistaken in my 
thinking, and I apologize for any confusion I may have caused you.
   
   
   
   
   
   
   
   ---- Replied Message ----
   | From | Jens ***@***.***> |
   | Date | 4/2/2024 20:43 |
   | To | ***@***.***> |
   | Cc | ***@***.***>,
   ***@***.***> |
   | Subject | Re: [apache/thrift] fix 1 bug about TSocket::write (PR #2953) |
   
   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 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.
   
   —
   Reply to this email directly, view it on GitHub, or unsubscribe.
   You are receiving this because you authored the thread.Message ID: 
***@***.***>


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