fix the bug that sql nio net thread will hang when do_pending_write

This commit is contained in:
obdev
2023-03-07 07:43:58 +00:00
committed by ob-robot
parent 37196ce6f0
commit d89d11164b

View File

@ -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;
} }