mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
[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 ===================================================================
This commit is contained in:
parent
395a24409d
commit
36888199ac
3 changed files with 23 additions and 0 deletions
|
@ -555,6 +555,17 @@ extern "C" {
|
|||
*/
|
||||
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
|
||||
* ndb_mgm_set_connectstring().
|
||||
|
|
|
@ -444,6 +444,16 @@ int ndb_mgm_set_connect_timeout(NdbMgmHandle handle, unsigned int seconds)
|
|||
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
|
||||
*/
|
||||
|
|
|
@ -240,6 +240,8 @@ int runTestApiTimeout1(NDBT_Context* ctx, NDBT_Step* step)
|
|||
|
||||
ndbout << "Inserted session error" << endl;
|
||||
|
||||
ndb_mgm_set_timeout(h,1000,1000);
|
||||
|
||||
cc= ndb_mgm_check_connection(h);
|
||||
if(cc < 0)
|
||||
result= NDBT_OK;
|
||||
|
|
Loading…
Reference in a new issue