File tree 2 files changed +42
-0
lines changed
2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -1727,6 +1727,17 @@ MgmApiSession::listen_event(Parser<MgmApiSession>::Context & ctx,
1727
1727
m_output->println (" msg: %s" , msg.c_str ());
1728
1728
m_output->println (" %s" , " " );
1729
1729
1730
+ /*
1731
+ Flush output from command before adding the new event listener.
1732
+ This makes sure that the client receives the reply before the
1733
+ loglevel thread starts to check the connection by sending <PING>'s.
1734
+ The client is expecting <PING>'s but not until after the reply has been
1735
+ received.
1736
+ */
1737
+ NdbMutex_Unlock (m_mutex);
1738
+ m_output->flush ();
1739
+ NdbMutex_Lock (m_mutex);
1740
+
1730
1741
if (result==0 )
1731
1742
{
1732
1743
m_mgmsrv.m_event_listner .add_listener (le);
Original file line number Diff line number Diff line change @@ -3572,6 +3572,34 @@ int runTestNdbApiConfig(NDBT_Context* ctx, NDBT_Step* step)
3572
3572
return NDBT_OK;
3573
3573
}
3574
3574
3575
+
3576
+ static
3577
+ int runTestCreateLogEvent (NDBT_Context* ctx, NDBT_Step* step)
3578
+ {
3579
+ NdbMgmd mgmd;
3580
+ int loops = ctx->getNumLoops ();
3581
+
3582
+ if (!mgmd.connect ())
3583
+ return NDBT_FAILED;
3584
+
3585
+ int filter[] = {
3586
+ 15 , NDB_MGM_EVENT_CATEGORY_BACKUP,
3587
+ 0
3588
+ };
3589
+
3590
+ for (int l=0 ; l<loops; l++)
3591
+ {
3592
+ g_info << " Creating log event handle " << l << endl;
3593
+ NdbLogEventHandle le_handle =
3594
+ ndb_mgm_create_logevent_handle (mgmd.handle (), filter);
3595
+ if (!le_handle)
3596
+ return NDBT_FAILED;
3597
+
3598
+ ndb_mgm_destroy_logevent_handle (&le_handle);
3599
+ }
3600
+ return NDBT_OK;
3601
+ }
3602
+
3575
3603
NDBT_TESTSUITE (testMgm);
3576
3604
DRIVER (DummyDriver); /* turn off use of NdbApi */
3577
3605
TESTCASE (" ApiSessionFailure" ,
@@ -3726,6 +3754,9 @@ TESTCASE("TestSetPorts",
3726
3754
" Test 'set ports'" ){
3727
3755
INITIALIZER (runTestSetPorts);
3728
3756
}
3757
+ TESTCASE (" TestCreateLogEvent" , " Test ndb_mgm_create_log_event_handle" ){
3758
+ STEPS (runTestCreateLogEvent, 5 );
3759
+ }
3729
3760
NDBT_TESTSUITE_END (testMgm);
3730
3761
3731
3762
int main (int argc, const char ** argv){
You can’t perform that action at this time.
0 commit comments