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
11
deps/oblib/src/rpc/obmysql/ob_sql_nio.cpp
vendored
11
deps/oblib/src/rpc/obmysql/ob_sql_nio.cpp
vendored
@ -336,9 +336,10 @@ private:
|
||||
class ObSqlSock: public ObLink
|
||||
{
|
||||
public:
|
||||
ObSqlSock(ObSqlNioImpl *nio, int fd): nio_impl_(nio), fd_(fd), err_(0), read_buffer_(fd),
|
||||
need_epoll_trigger_write_(false), may_handling_(true), handler_close_flag_(false),
|
||||
need_shutdown_(false), last_decode_time_(0), last_write_time_(0), sql_session_info_(NULL) {
|
||||
ObSqlSock(ObSqlNioImpl *nio, int fd): dlink_(), all_list_link_(), write_task_link_(), nio_impl_(nio),
|
||||
fd_(fd), err_(0), read_buffer_(fd), need_epoll_trigger_write_(false), may_handling_(true),
|
||||
handler_close_flag_(false), need_shutdown_(false), last_decode_time_(0), last_write_time_(0),
|
||||
sql_session_info_(NULL) {
|
||||
memset(sess_, 0, sizeof(sess_));
|
||||
}
|
||||
~ObSqlSock() {}
|
||||
@ -746,8 +747,10 @@ public:
|
||||
while (cur != head) {
|
||||
ObSqlSock* s = CONTAINER_OF(cur, ObSqlSock, all_list_link_);
|
||||
cur = cur->next_;
|
||||
if (s->set_error(EIO)) {
|
||||
prepare_destroy(s);
|
||||
}
|
||||
}
|
||||
while(head->next_ != head) {
|
||||
handle_write_req_queue();
|
||||
handle_pending_destroy_list();
|
||||
@ -839,7 +842,7 @@ private:
|
||||
}
|
||||
if (OB_UNLIKELY(0 != err)) {
|
||||
revert_sock(s);
|
||||
if (s->set_error(err)) {
|
||||
if (s->set_error(EIO)) {
|
||||
prepare_destroy(s);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user