Skip to content

Commit 716fe86

Browse files
committed
Bug#35714466 Timeout too long on MGMAPI connections converted to transporters
When a TransporterRegistry (TR) instance is connecting to an MGMD, it first connects using MGMAPI, and then converts the connection to a Transporter connection for further communication. The initial MGMAPI connection should have a timeout set so that the TR instance does not spend too long waiting for unsuccessful connection attempts to time out. The MGMAPI connection timeout is set equal to the MGMAPI connection timeout used by the TR for the connection it uses for getting/setting dynamic ports. Change-Id: I3e3361dff3fca88ca0792c07222629c48359daf8
1 parent f9f062e commit 716fe86

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

storage/ndb/src/common/transporter/TransporterRegistry.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,25 @@ TransporterRegistry::TransporterRegistry(TransporterCallback *callback,
322322
DBUG_VOID_RETURN;
323323
}
324324

325+
/**
326+
* Time limit for individual MGMAPI activities, including
327+
* TCP connection
328+
* Handshake, auth, TLS
329+
* MGMAPI command responses (except where overridden)
330+
* Affects:
331+
* - TR MGMAPI connection used to manage dynamic ports
332+
* - Transporter-to-MGMD MGMAPI connections converted
333+
* to transporters
334+
*/
335+
static const Uint32 MGM_TIMEOUT_MILLIS=5000;
336+
325337
void TransporterRegistry::set_mgm_handle(NdbMgmHandle h)
326338
{
327339
DBUG_ENTER("TransporterRegistry::set_mgm_handle");
328340
if (m_mgm_handle)
329341
ndb_mgm_destroy_handle(&m_mgm_handle);
330342
m_mgm_handle= h;
331-
ndb_mgm_set_timeout(m_mgm_handle, 5000);
343+
ndb_mgm_set_timeout(m_mgm_handle, MGM_TIMEOUT_MILLIS);
332344
#ifndef NDEBUG
333345
if (h)
334346
{
@@ -2670,6 +2682,11 @@ TransporterRegistry::connect_ndb_mgmd(const char* server_name,
26702682
ndb_mgm_set_connectstring(h, cs.c_str());
26712683
}
26722684

2685+
/**
2686+
* Set timeout
2687+
*/
2688+
ndb_mgm_set_timeout(h, MGM_TIMEOUT_MILLIS);
2689+
26732690
if(ndb_mgm_connect(h, 0, 0, 0)<0)
26742691
{
26752692
DBUG_PRINT("info", ("connection to mgmd failed"));

0 commit comments

Comments
 (0)