@@ -967,7 +967,7 @@ void Ndb::closeTransaction(NdbTransaction *aConnection) {
967967// application behaviour.
968968// -----------------------------------------------------
969969#ifdef VM_TRACE
970- printf ( " NULL into closeTransaction \n " );
970+ g_eventLogger-> info ( " Ndb::closeTransaction passed nullptr " );
971971#endif
972972 DBUG_VOID_RETURN;
973973 } // if
@@ -1003,15 +1003,18 @@ void Ndb::closeTransaction(NdbTransaction *aConnection) {
10031003 * something else...
10041004 */
10051005#ifdef VM_TRACE
1006- printf (
1007- " Scan timeout:ed NdbTransaction-> "
1008- " not returning it -> memory leak\n " );
1006+ g_eventLogger-> warning (
1007+ " Ndb::closeTransaction() scan time out, not "
1008+ " returning NdbTransaction -> memory leak" );
10091009#endif
10101010 DBUG_VOID_RETURN;
10111011 }
10121012
10131013#ifdef VM_TRACE
1014- printf (" Non-existing transaction into closeTransaction\n " );
1014+ fprintf (stderr,
1015+ " %s NDBAPI FATAL ERROR : Non-existing transaction %p "
1016+ " passed into closeTransaction on Ndb %p\n " ,
1017+ Logger::Timestamp ().c_str (), aConnection, this );
10151018 abort ();
10161019#endif
10171020 DBUG_VOID_RETURN;
@@ -1032,9 +1035,9 @@ void Ndb::closeTransaction(NdbTransaction *aConnection) {
10321035 * to reuse. And TC crashes when the API tries to reuse it to
10331036 * something else...
10341037 */
1035- # ifdef VM_TRACE
1036- printf ( " Con timeout:ed NdbTransaction-> not returning it-> memory leak \n " );
1037- # endif
1038+ g_eventLogger-> warning (
1039+ " Ndb::closeTransaction() passed a timed out NdbTransaction, not "
1040+ " returning it -> resource leak " );
10381041 DBUG_VOID_RETURN;
10391042 }
10401043
@@ -1861,9 +1864,6 @@ NdbEventOperation *Ndb::getEventOperation(NdbEventOperation *tOp) {
18611864
18621865int Ndb::pollEvents2 (int aMillisecondNumber, Uint64 *highestQueuedEpoch) {
18631866 if (unlikely (aMillisecondNumber < 0 )) {
1864- g_eventLogger->error (
1865- " Ndb::pollEvents2: negative aMillisecondNumber %d 0x%x %s" ,
1866- aMillisecondNumber, getReference (), getNdbObjectName ());
18671867 return -1 ;
18681868 }
18691869
@@ -1893,19 +1893,21 @@ bool Ndb::isExpectingHigherQueuedEpochs() {
18931893}
18941894
18951895void Ndb::printOverflowErrorAndExit () {
1896- g_eventLogger-> error ( " Ndb Event Buffer : 0x%x %s " , getReference () ,
1897- getNdbObjectName ());
1898- g_eventLogger-> error ( " Ndb Event Buffer : Event buffer out of memory." );
1899- g_eventLogger-> error ( " Ndb Event Buffer : Fatal error. " );
1896+ fprintf (stderr ,
1897+ " %s NDBAPI FATAL ERROR : Ndb Event Buffer : 0x%x %s \n "
1898+ " Event buffer out of memory.\n " ,
1899+ Logger::Timestamp (). c_str (), getReference (), getNdbObjectName () );
19001900 Uint64 maxalloc = get_eventbuf_max_alloc ();
19011901 if (maxalloc != 0 ) {
19021902 // limited memory is allocated for event buffer, give recommendation
1903- g_eventLogger->error (
1904- " Ndb Event Buffer : Change eventbuf_max_alloc (Current max_alloc is "
1905- " %llu)." ,
1906- maxalloc);
1907- }
1908- g_eventLogger->error (" Ndb Event Buffer : Consider using the new API." );
1903+ fprintf (stderr,
1904+ " Consider changing eventbuf_max_alloc (Current max_alloc is "
1905+ " %llu).\n " ,
1906+ maxalloc);
1907+ }
1908+ fprintf (stderr,
1909+ " Out of Memory events can be handled non fatally "
1910+ " using nextEvent2().\n " );
19091911 exit (-1 );
19101912}
19111913
@@ -1962,11 +1964,14 @@ NdbEventOperation *Ndb::nextEvent() {
19621964 }
19631965
19641966 if (unlikely (op->isEmptyEpoch ())) {
1965- g_eventLogger->error (
1966- " Ndb::nextEvent: Found exceptional event type "
1967- " TE_EMPTY when using old event API. "
1968- " Turn off empty epoch queuing by "
1969- " setEventBufferQueueEmptyEpoch(false)." );
1967+ fprintf (stderr,
1968+ " %s NDBAPI FATAL ERROR : Ndb::nextEvent() : Found "
1969+ " exceptional event type TE_EMPTY when using old "
1970+ " event API nextEvent() call. "
1971+ " Turn off empty epoch queuing by "
1972+ " setEventBufferQueueEmptyEpoch(false) "
1973+ " or use new API nextEvent2().\n " ,
1974+ Logger::Timestamp ().c_str ());
19701975 exit (-1 );
19711976 }
19721977 return op;
0 commit comments