jingshi-ant commented on issue #2166:
URL: https://github.com/apache/brpc/issues/2166#issuecomment-1480761863

   update:
   
测试了下半同步发送,程序会因为ssl内部状态revive,从而出现类似上述重复创建channel导致的crash。增加如下补丁后,半同步发送的稳定性提升,请教下Disable
 renegotiation的原因?看ssl文档,这种场景下是可以重试的:
   diff --git a/src/brpc/socket.cpp b/src/brpc/socket.cpp
   index e3878c19..b300206f 100644
   --- a/src/brpc/socket.cpp
   +++ b/src/brpc/socket.cpp
   @@ -1824,10 +1824,6 @@ ssize_t Socket::DoWrite(WriteRequest* req) {
            break;
    
        case SSL_ERROR_WANT_READ:
   -        // Disable renegotiation
   -        errno = EPROTO;
   -        return -1;
   -
        case SSL_ERROR_WANT_WRITE:
            errno = EAGAIN;
            break;
   @@ -1973,9 +1969,8 @@ ssize_t Socket::DoRead(size_t size_hint) {
            break;
                
        case SSL_ERROR_WANT_WRITE:
   -        // Disable renegotiation
   -        errno = EPROTO;
   -        return -1;
   +        errno = EAGAIN;
   +        break;
    
        default: {
            const unsigned long e = ERR_get_error();


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to