fix kill 15 core

This commit is contained in:
zhjc1124
2023-05-17 09:17:51 +00:00
committed by ob-robot
parent 906aa86e76
commit 70d62e0bc8
8 changed files with 95 additions and 15 deletions

View File

@ -735,21 +735,18 @@ public:
tcp_keepintvl_ = tcp_keepintvl;
tcp_keepcnt_ = tcp_keepcnt;
}
void close_all_fd() {
if (lfd_ > 0) {
IGNORE_RETURN epoll_ctl(epfd_, EPOLL_CTL_DEL, lfd_, NULL);
close(lfd_);
lfd_ = -1;
}
void close_all() {
ObDLink* head = all_list_.head();
ObLink* cur = head->next_;
while (cur != head) {
ObSqlSock* s = CONTAINER_OF(cur, ObSqlSock, all_list_link_);
cur = cur->next_;
s->on_disconnect();
ObSqlSockSession *sess = (ObSqlSockSession *)s->sess_;
sess->destroy();
s->do_close();
prepare_destroy(s);
}
while(head->next_ != head) {
handle_write_req_queue();
handle_close_req_queue();
handle_pending_destroy_list();
}
}
private:
@ -1065,7 +1062,7 @@ void ObSqlNio::run(int64_t idx)
impl_[idx].do_work();
}
if (has_set_stop()) {
impl_[idx].close_all_fd();
impl_[idx].close_all();
}
}
}