[CP] fix change user and quit not send disconnect

This commit is contained in:
obdev
2024-02-06 17:52:13 +00:00
committed by ob-robot
parent fcaa9921e8
commit 783fcdf212
3 changed files with 8 additions and 3 deletions

View File

@ -254,6 +254,7 @@ int ObMPChangeUser::process()
if (OB_FAIL(send_error_packet(ret, NULL))) {
OB_LOG(WARN,"response fail packet fail", K(ret));
}
need_disconnect = true;
}
if (OB_UNLIKELY(need_disconnect) && is_conn_valid()) {

View File

@ -52,6 +52,7 @@ int ObMPQuit::process()
if (NULL != session) {
revert_session(session);
}
disconnect();
SERVER_LOG(INFO, "quit");
return ret;
}

View File

@ -42,8 +42,6 @@ int ObMPStatistic::process()
LOG_WARN("failed to alloc easy buf", K(ret));
} else if (OB_FAIL(packet_sender_.update_last_pkt_pos())) {
LOG_WARN("failed to update last packet pos", K(ret));
} else if (OB_FAIL(response_packet(pkt, NULL))) {
RPC_OBMYSQL_LOG(WARN, "fail to response statistic packet", K(ret));
} else if (OB_ISNULL(conn = get_conn())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get connection fail", K(conn), K(ret));
@ -62,14 +60,19 @@ int ObMPStatistic::process()
LOG_WARN("update transmisson checksum flag failed", K(ret));
} else {
ObOKPParam ok_param; // use default values
if (OB_FAIL(send_ok_packet(*session, ok_param))) {
if (OB_FAIL(send_ok_packet(*session, ok_param, &pkt))) {
LOG_WARN("fail to send ok pakcet in statistic response", K(ok_param), K(ret));
}
}
if (OB_LIKELY(NULL != session)) {
revert_session(session);
}
} else if (OB_FAIL(response_packet(pkt, NULL))) {
RPC_OBMYSQL_LOG(WARN, "fail to response statistic packet", K(ret));
} else {
// do nothing
}
if (OB_FAIL(ret) && need_response_error) {
send_error_packet(ret, NULL);
}