feifeiiong opened a new issue #1033: redis 认证机制在重试策略下存在问题/controller中 auth 
flag存在的意义?
URL: https://github.com/apache/incubator-brpc/issues/1033
 
 
   **Describe the bug (描述bug)**
   发生rpc重试时,socket的auth状态与pipline的auth状态有可能不一致。
   模式:连接池
   
   **To Reproduce (复现方法)**
   在连接池模式下,若发起redis请求后失败需要重试(如tcp 连接超时 connect time 
out),此时有可能出现controller已被置FLAGS_REQUEST_WITH_AUTH标志位(pip 
line依赖此标志位),而从池中拿出的socket已认证过无需auth的情况,从而导致解包失败,出现认证失败的错误( "Redis Auth failed: 
" )。
   
   代码位置:
   
![image](https://user-images.githubusercontent.com/4979167/72701432-43f6e100-3b8a-11ea-9bdf-82a5968f2ea8.png)
   发生重试时,若此处auth为NULL(取出的socket已认证),controller的标志位未清除,从而导致pipline的标志位出错。
   
![image](https://user-images.githubusercontent.com/4979167/72701524-8d473080-3b8a-11ea-9e57-0fe15647ed92.png)
   这里的疑问是,为什么需要一个这样的标志位?为什么redis的认证不能与socket保持一致?
   即:
   wopt.with_auth = _auth;
   希望能够得到解答。
   **Expected behavior (期望行为)**
   
   redis的pipline中的auth状态应与socket保持一致,而非controller。
   **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


With regards,
Apache Git Services

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

Reply via email to