mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 11:31:51 +01:00
Merge ssmith@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into mysql.com:/home/stewart/Documents/MySQL/5.0/bug10950 ndb/src/common/transporter/TransporterRegistry.cpp: Auto merged ndb/src/mgmapi/mgmapi.cpp: manual merge.
This commit is contained in:
commit
11577be8b3
2 changed files with 39 additions and 11 deletions
|
@ -1310,11 +1310,17 @@ TransporterRegistry::start_clients_thread()
|
|||
if (server_port)
|
||||
t->set_s_port(server_port);
|
||||
}
|
||||
else
|
||||
else if(ndb_mgm_is_connected(m_mgm_handle))
|
||||
{
|
||||
ndbout_c("Failed to get dynamic port to connect to: %d", res);
|
||||
ndb_mgm_disconnect(m_mgm_handle);
|
||||
}
|
||||
else
|
||||
{
|
||||
ndbout_c("Management server closed connection early. "
|
||||
"It is probably being shut down (or has crashed). "
|
||||
"We will retry the connection.");
|
||||
}
|
||||
}
|
||||
/** else
|
||||
* We will not be able to get a new port unless
|
||||
|
|
|
@ -326,6 +326,11 @@ ndb_mgm_call(NdbMgmHandle handle, const ParserRow<ParserDummy> *command_reply,
|
|||
|
||||
const Properties* p = parser.parse(ctx, session);
|
||||
if (p == NULL){
|
||||
if(!ndb_mgm_is_connected(handle)) {
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
/**
|
||||
* Print some info about why the parser returns NULL
|
||||
*/
|
||||
|
@ -337,6 +342,7 @@ ndb_mgm_call(NdbMgmHandle handle, const ParserRow<ParserDummy> *command_reply,
|
|||
DBUG_PRINT("info",("ctx.status: %d, ctx.m_currentToken: %s",
|
||||
ctx.m_status, ctx.m_currentToken));
|
||||
}
|
||||
}
|
||||
#ifdef MGMAPI_LOG
|
||||
else {
|
||||
/**
|
||||
|
@ -354,8 +360,24 @@ ndb_mgm_call(NdbMgmHandle handle, const ParserRow<ParserDummy> *command_reply,
|
|||
extern "C"
|
||||
int ndb_mgm_is_connected(NdbMgmHandle handle)
|
||||
{
|
||||
struct pollfd pfd[1];
|
||||
int r;
|
||||
|
||||
if(!handle)
|
||||
return 0;
|
||||
|
||||
if(handle->connected)
|
||||
{
|
||||
pfd[0].fd= handle->socket;
|
||||
pfd[0].events= POLLHUP | POLLIN | POLLOUT | POLLNVAL;
|
||||
pfd[0].revents= 0;
|
||||
r= poll(pfd,1,0);
|
||||
if(pfd[0].revents & POLLHUP)
|
||||
{
|
||||
handle->connected= 0;
|
||||
NDB_CLOSE_SOCKET(handle->socket);
|
||||
}
|
||||
}
|
||||
return handle->connected;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue