fix not exit immediately when session killed

This commit is contained in:
obdev
2024-02-09 14:55:05 +00:00
committed by ob-robot
parent 3897e45a83
commit a0c1edc5c0

View File

@ -249,6 +249,21 @@ void ObPxSqcAsyncProxy::fail_process() {
LOG_WARN_RET(OB_SUCCESS,
"async sqc fails, process the callbacks that have not yet got results",
K(return_cb_count_), K(callbacks_.count()));
ARRAY_FOREACH_X(callbacks_, idx, count, true) {
ObSqcAsyncCB &callback = *callbacks_.at(idx);
if (!callback.is_visited() &&
!(callback.is_processed() || callback.is_timeout() || callback.is_invalid())) {
// unregister async callbacks that have not received response.
ObAsyncRespCallback *async_cb = static_cast<ObAsyncRespCallback *>(callback.low_level_cb_);
uint64_t gtid = async_cb->gtid_;
uint32_t pkt_id = async_cb->pkt_id_;
int err = 0;
if ((err = pn_terminate_pkt(gtid, pkt_id)) != 0) {
int ret = tranlate_to_ob_error(err);
LOG_WARN("terminate pkt failed", K(ret), K(err));
}
}
}
while (return_cb_count_ < callbacks_.count()) {
ObThreadCondGuard guard(cond_);
ARRAY_FOREACH_X(callbacks_, idx, count, true) {