fix the bug that sql nio net thread will hang when do_pending_write
This commit is contained in:
6
deps/oblib/src/rpc/obmysql/ob_sql_nio.cpp
vendored
6
deps/oblib/src/rpc/obmysql/ob_sql_nio.cpp
vendored
@ -308,7 +308,8 @@ private:
|
|||||||
if ((wbytes = ob_write_regard_ssl(fd, buf + pos, sz - pos)) >= 0) {
|
if ((wbytes = ob_write_regard_ssl(fd, buf + pos, sz - pos)) >= 0) {
|
||||||
pos += wbytes;
|
pos += wbytes;
|
||||||
} else if (EAGAIN == errno || EWOULDBLOCK == errno) {
|
} else if (EAGAIN == errno || EWOULDBLOCK == errno) {
|
||||||
LOG_INFO("write return EAGAIN");
|
LOG_INFO("write return EAGAIN", K(fd));
|
||||||
|
ret = OB_EAGAIN;
|
||||||
} else if (EINTR == errno) {
|
} else if (EINTR == errno) {
|
||||||
// pass
|
// pass
|
||||||
} else {
|
} else {
|
||||||
@ -316,8 +317,9 @@ private:
|
|||||||
LOG_WARN("write data error", K(errno));
|
LOG_WARN("write data error", K(errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (OB_SUCCESS == ret) {
|
if (OB_SUCCESS == ret || EAGAIN == ret) {
|
||||||
consume_bytes = pos;
|
consume_bytes = pos;
|
||||||
|
ret = OB_SUCCESS;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user