joway opened a new issue #1406:
URL: https://github.com/apache/incubator-brpc/issues/1406


   **Describe the bug (描述bug)**
   
   Hi, thanks for creating such an amazing RPC framework!
   
   I'm learning this project recently but found brpc will retry to send request 
when meeting `ETIMEDOUT` error. But In my understanding, ETIMEDOUT means:
   
   > A connect(2) or send(2) request failed
      because the connected party did not properly respond after a
      period of time.  (The timeout period is dependent on the communi-
      cation protocol.) 
   
   If the server-side has processed the request, but not send ACK to the client 
successfully, the client will get the `ETIMEDOUT` error, and retry to send the 
same request, which will cause unexpected behavior for the non-idempotent API.
   
   ```
   +----------+                                +----------+                     
  
   |  Client  |                                |  Server  |                     
  
   +----------+                                +----------+                     
  
        |                                           |                           
  
        |                                           |                           
  
        |                   PSH ==>                 |                           
  
        |-------------------------------------------|                           
  
        |                                           |                           
  
        |                                           |                           
  
        |                 <== ACK                   |                           
  
        |     Lost ---------------------------------|                           
  
        |                                           |                           
  
        |                                           |Process                    
  
        |                                           ---------                   
  
        |                                           |                           
  
        |                                           | Crash                     
  
        |                                           ---------                   
  
        |                                           |                           
  
        |                                           |                           
  
        |                                           |                           
  
        |                                           |                           
  
        |                                           |                           
  
        |                                           |                           
               
   ```
   
   There is a slide talk about it more clearly: 
https://www.slideshare.net/PeterREgli/transport-protocols
   
   Let me know if I miss anything, thanks!
   
   
![image](https://user-images.githubusercontent.com/8353464/118490391-7b5ea900-b750-11eb-97e3-806b6d726a73.png)
   
   **To Reproduce (复现方法)**
   
   
https://github.com/apache/incubator-brpc/blob/60159fc3f3e13490fb9806ea0a0cb0dcdbda7f7d/src/brpc/retry_policy.cpp#L37
   
   **Expected behavior (期望行为)**
   
   ETIMEDOUT should not be included in default retriable error codes.
   
   **Versions (各种版本)**
   OS:
   Compiler:
   brpc:
   protobuf:
   
   **Additional context/screenshots (更多上下文/截图)**
   
   


-- 
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to