fix the core of sql nio when observer is stopping part 2
This commit is contained in:
committed by
ob-robot
parent
9ee5e323e4
commit
5ef87ac073
13
deps/oblib/src/rpc/obmysql/ob_sql_nio.cpp
vendored
13
deps/oblib/src/rpc/obmysql/ob_sql_nio.cpp
vendored
@ -336,9 +336,10 @@ private:
|
|||||||
class ObSqlSock: public ObLink
|
class ObSqlSock: public ObLink
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ObSqlSock(ObSqlNioImpl *nio, int fd): nio_impl_(nio), fd_(fd), err_(0), read_buffer_(fd),
|
ObSqlSock(ObSqlNioImpl *nio, int fd): dlink_(), all_list_link_(), write_task_link_(), nio_impl_(nio),
|
||||||
need_epoll_trigger_write_(false), may_handling_(true), handler_close_flag_(false),
|
fd_(fd), err_(0), read_buffer_(fd), need_epoll_trigger_write_(false), may_handling_(true),
|
||||||
need_shutdown_(false), last_decode_time_(0), last_write_time_(0), sql_session_info_(NULL) {
|
handler_close_flag_(false), need_shutdown_(false), last_decode_time_(0), last_write_time_(0),
|
||||||
|
sql_session_info_(NULL) {
|
||||||
memset(sess_, 0, sizeof(sess_));
|
memset(sess_, 0, sizeof(sess_));
|
||||||
}
|
}
|
||||||
~ObSqlSock() {}
|
~ObSqlSock() {}
|
||||||
@ -746,7 +747,9 @@ public:
|
|||||||
while (cur != head) {
|
while (cur != head) {
|
||||||
ObSqlSock* s = CONTAINER_OF(cur, ObSqlSock, all_list_link_);
|
ObSqlSock* s = CONTAINER_OF(cur, ObSqlSock, all_list_link_);
|
||||||
cur = cur->next_;
|
cur = cur->next_;
|
||||||
prepare_destroy(s);
|
if (s->set_error(EIO)) {
|
||||||
|
prepare_destroy(s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
while(head->next_ != head) {
|
while(head->next_ != head) {
|
||||||
handle_write_req_queue();
|
handle_write_req_queue();
|
||||||
@ -839,7 +842,7 @@ private:
|
|||||||
}
|
}
|
||||||
if (OB_UNLIKELY(0 != err)) {
|
if (OB_UNLIKELY(0 != err)) {
|
||||||
revert_sock(s);
|
revert_sock(s);
|
||||||
if (s->set_error(err)) {
|
if (s->set_error(EIO)) {
|
||||||
prepare_destroy(s);
|
prepare_destroy(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user