Commit a69b2aa7 authored by unknown's avatar unknown

[PATCH] WL#3704 mgmapi timeouts: use timeouts in mgm client

as side effect - turbo accellerator patch for ndb_mgm - sholud make it quicker... so that 4mhz cpu will seem even faster.

Index: ndb-work/storage/ndb/src/mgmclient/CommandInterpreter.cpp
===================================================================


storage/ndb/src/mgmclient/CommandInterpreter.cpp:
  WL#3704 mgmapi timeouts: use timeouts in mgm client
parent aa8b15b7
...@@ -726,10 +726,9 @@ event_thread_run(void* p) ...@@ -726,10 +726,9 @@ event_thread_run(void* p)
do_event_thread= 1; do_event_thread= 1;
char *tmp= 0; char *tmp= 0;
char buf[1024]; char buf[1024];
SocketInputStream in(fd,10);
do { do {
if (tmp == 0) NdbSleep_MilliSleep(10); SocketInputStream in(fd,2000);
if((tmp = in.gets(buf, 1024))) if((tmp = in.gets(buf, sizeof(buf))))
{ {
const char ping_token[]= "<PING>"; const char ping_token[]= "<PING>";
if (memcmp(ping_token,tmp,sizeof(ping_token)-1)) if (memcmp(ping_token,tmp,sizeof(ping_token)-1))
...@@ -739,6 +738,10 @@ event_thread_run(void* p) ...@@ -739,6 +738,10 @@ event_thread_run(void* p)
ndbout << tmp; ndbout << tmp;
} }
} }
else if(in.timedout() && ndb_mgm_check_connection(handle)<0)
{
break;
}
} while(do_event_thread); } while(do_event_thread);
NDB_CLOSE_SOCKET(fd); NDB_CLOSE_SOCKET(fd);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment