add _stream_rpc_max_wait_timeout to avoid tenant worker hung for waiting next request

This commit is contained in:
obdev
2024-02-06 17:14:43 +00:00
committed by ob-robot
parent c76d29895d
commit da9fb8d38f
6 changed files with 27 additions and 2 deletions

View File

@ -568,6 +568,16 @@ int64_t get_max_rpc_packet_size()
{
return GCONF._max_rpc_packet_size;
}
int64_t get_stream_rpc_max_wait_timeout(int64_t tenant_id)
{
int64_t stream_rpc_max_wait_timeout = ObRpcProcessorBase::DEFAULT_WAIT_NEXT_PACKET_TIMEOUT;
omt::ObTenantConfigGuard tenant_config(TENANT_CONF(tenant_id));
if (OB_LIKELY(tenant_config.is_valid())) {
stream_rpc_max_wait_timeout = tenant_config->_stream_rpc_max_wait_timeout;
}
return stream_rpc_max_wait_timeout;
}
} // end of namespace obrpc
} // end of namespace oceanbase

View File

@ -768,6 +768,9 @@ DEF_TIME(_ob_get_gts_ahead_interval, OB_CLUSTER_PARAMETER, "0s", "[0s, 1s]",
DEF_TIME(rpc_timeout, OB_CLUSTER_PARAMETER, "2s",
"the time during which a RPC request is permitted to execute before it is terminated",
ObParameterAttr(Section::RPC, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_TIME(_stream_rpc_max_wait_timeout, OB_TENANT_PARAMETER, "30s", "[1s,)",
"the maximum timeout for a tenant worker thread to wait for the next request while processing streaming RPC",
ObParameterAttr(Section::RPC, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_BOOL(_enable_pkt_nio, OB_CLUSTER_PARAMETER, "True",
"enable pkt-nio, the new RPC framework"
"Value: True:turned on; False: turned off",