Commit ef41a27c authored by unknown's avatar unknown

[PATCH] WL#3704 mgmapi timeouts: add ndb_mgm_set_timeout(h,ms)

Add not so neat set_timeout call to make testMgm work

Index: ndb-work/storage/ndb/include/mgmapi/mgmapi.h
===================================================================


storage/ndb/include/mgmapi/mgmapi.h:
  WL#3704 mgmapi timeouts: add ndb_mgm_set_timeout(h,ms)
storage/ndb/src/mgmapi/mgmapi.cpp:
  WL#3704 mgmapi timeouts: add ndb_mgm_set_timeout(h,ms)
storage/ndb/test/ndbapi/testMgm.cpp:
  WL#3704 mgmapi timeouts: add ndb_mgm_set_timeout(h,ms)
parent b3dd80dd
...@@ -555,6 +555,17 @@ extern "C" { ...@@ -555,6 +555,17 @@ extern "C" {
*/ */
int ndb_mgm_set_connect_timeout(NdbMgmHandle handle, unsigned int seconds); int ndb_mgm_set_connect_timeout(NdbMgmHandle handle, unsigned int seconds);
/**
* Sets the number of milliseconds for timeout for read and write operations
* to the socket
* Default is 50,000 for read, 1000 for write
*
* @param handle NdbMgmHandle
* @param rw_milliseconds number of milliseconds
* @return zero on success
*/
int ndb_mgm_set_timeout(NdbMgmHandle handle, unsigned int rw_milliseconds);
/** /**
* Connects to a management server. Connectstring is set by * Connects to a management server. Connectstring is set by
* ndb_mgm_set_connectstring(). * ndb_mgm_set_connectstring().
......
...@@ -444,6 +444,16 @@ int ndb_mgm_set_connect_timeout(NdbMgmHandle handle, unsigned int seconds) ...@@ -444,6 +444,16 @@ int ndb_mgm_set_connect_timeout(NdbMgmHandle handle, unsigned int seconds)
return 0; return 0;
} }
extern "C"
int ndb_mgm_set_timeout(NdbMgmHandle handle, unsigned int rw_milliseconds)
{
if(!handle)
return -1;
handle->read_timeout= handle->write_timeout= rw_milliseconds;
return 0;
}
/** /**
* Connect to a management server * Connect to a management server
*/ */
......
...@@ -240,6 +240,8 @@ int runTestApiTimeout1(NDBT_Context* ctx, NDBT_Step* step) ...@@ -240,6 +240,8 @@ int runTestApiTimeout1(NDBT_Context* ctx, NDBT_Step* step)
ndbout << "Inserted session error" << endl; ndbout << "Inserted session error" << endl;
ndb_mgm_set_timeout(h,1000,1000);
cc= ndb_mgm_check_connection(h); cc= ndb_mgm_check_connection(h);
if(cc < 0) if(cc < 0)
result= NDBT_OK; result= NDBT_OK;
......
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