Files
doris/thirdparty/patches/brpc-stream-check-connected.patch
Yongqiang YANG c1c8376eb2 [fix](thirdparty) brpc stream crash on error stream (#27016)
* [fix](thirdparty) brpc stream crash on error stream

* rename
2023-11-15 18:24:01 +08:00

16 lines
571 B
Diff

diff --git a/src/brpc/socket.cpp b/src/brpc/socket.cpp
index e3878c1..75c5b98 100644
--- a/src/brpc/socket.cpp
+++ b/src/brpc/socket.cpp
@@ -1451,7 +1451,9 @@ void Socket::CheckConnectedAndKeepWrite(int fd, int err, void* data) {
butil::fd_guard sockfd(fd);
WriteRequest* req = static_cast<WriteRequest*>(data);
Socket* s = req->socket;
- CHECK_GE(sockfd, 0);
+ if (err == 0) {
+ CHECK_GE(sockfd, 0);
+ }
if (err == 0 && s->CheckConnected(sockfd) == 0
&& s->ResetFileDescriptor(sockfd) == 0) {
if (s->_app_connect) {