fix a memleak caused by not release inner sql conn immediately when start trans failed in remote obs
This commit is contained in:
@ -666,11 +666,16 @@ int ObInnerSqlRpcP::process()
|
|||||||
}
|
}
|
||||||
if (OB_NOT_NULL(conn)) {
|
if (OB_NOT_NULL(conn)) {
|
||||||
bool need_reuse_conn = true;
|
bool need_reuse_conn = true;
|
||||||
const bool in_trans = OB_INVALID_ID != transmit_arg.get_conn_id() || ObInnerSQLTransmitArg::OPERATION_TYPE_START_TRANSACTION == transmit_arg.get_operation_type();
|
const bool is_start_trans = ObInnerSQLTransmitArg::OPERATION_TYPE_START_TRANSACTION
|
||||||
if (!in_trans // need to release conn if not in a trans
|
== transmit_arg.get_operation_type();
|
||||||
|
const bool in_trans = is_start_trans || OB_INVALID_ID != transmit_arg.get_conn_id();
|
||||||
|
if (!in_trans
|
||||||
|
// need to release conn if not in a trans
|
||||||
|| ObInnerSQLTransmitArg::OPERATION_TYPE_ROLLBACK == transmit_arg.get_operation_type()
|
|| ObInnerSQLTransmitArg::OPERATION_TYPE_ROLLBACK == transmit_arg.get_operation_type()
|
||||||
|| ObInnerSQLTransmitArg::OPERATION_TYPE_COMMIT == transmit_arg.get_operation_type()
|
|| ObInnerSQLTransmitArg::OPERATION_TYPE_COMMIT == transmit_arg.get_operation_type()
|
||||||
// need to release conn after commit or rollback
|
// need to release conn after commit or rollback
|
||||||
|
|| (OB_FAIL(ret) && is_start_trans)
|
||||||
|
// need to release conn if start_trans was failed
|
||||||
) {
|
) {
|
||||||
need_reuse_conn = false;
|
need_reuse_conn = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user