summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2005-02-23 10:12:26 +0100
committerunknown <tomas@poseidon.ndb.mysql.com>2005-02-23 10:12:26 +0100
commite1d76d166304c96b8f35fc782aafd374a42bc8c5 (patch)
treeeb1f939372137787de9a180f6aa98a264ae03c14
parent8776230074184a255e8df4c5c4eb45e66fc81fe0 (diff)
downloadmariadb-git-e1d76d166304c96b8f35fc782aafd374a42bc8c5.tar.gz
removed printout "- Repeated 1 times"
make sure transporter connections are close early in shutdown ndb/src/common/logger/LogHandler.cpp: removed printout "- Repeated 1 times" ndb/src/kernel/main.cpp: make sure transporter connections are close early in shutdown ndb/src/kernel/vm/Emulator.cpp: make sure transporter connections are close early in shutdown ndb/src/kernel/vm/Emulator.hpp: make sure transporter connections are close early in shutdown
-rw-r--r--ndb/src/common/logger/LogHandler.cpp4
-rw-r--r--ndb/src/kernel/main.cpp11
-rw-r--r--ndb/src/kernel/vm/Emulator.cpp18
-rw-r--r--ndb/src/kernel/vm/Emulator.hpp3
4 files changed, 23 insertions, 13 deletions
diff --git a/ndb/src/common/logger/LogHandler.cpp b/ndb/src/common/logger/LogHandler.cpp
index e038b05401e..ec4137297f1 100644
--- a/ndb/src/common/logger/LogHandler.cpp
+++ b/ndb/src/common/logger/LogHandler.cpp
@@ -76,15 +76,15 @@ LogHandler::append_impl(const char* pCategory, Logger::LoggerLevel level,
const char* pMsg)
{
writeHeader(pCategory, level);
- if (m_count_repeated_messages == 0)
+ if (m_count_repeated_messages <= 1)
writeMessage(pMsg);
else
{
BaseString str(pMsg);
str.appfmt(" - Repeated %d times", m_count_repeated_messages);
writeMessage(str.c_str());
- m_count_repeated_messages= 0;
}
+ m_count_repeated_messages= 0;
writeFooter();
}
diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp
index 448bdd9a1fa..e6e0a7ca877 100644
--- a/ndb/src/kernel/main.cpp
+++ b/ndb/src/kernel/main.cpp
@@ -180,11 +180,9 @@ int main(int argc, char** argv)
assert("Illegal state globalData.theRestartFlag" == 0);
}
- SocketServer socket_server;
-
globalTransporterRegistry.startSending();
globalTransporterRegistry.startReceiving();
- if (!globalTransporterRegistry.start_service(socket_server)){
+ if (!globalTransporterRegistry.start_service(*globalEmulatorData.m_socket_server)){
ndbout_c("globalTransporterRegistry.start_service() failed");
exit(-1);
}
@@ -196,7 +194,7 @@ int main(int argc, char** argv)
globalEmulatorData.theWatchDog->doStart();
- socket_server.startServer();
+ globalEmulatorData.m_socket_server->startServer();
// theConfig->closeConfiguration();
@@ -204,11 +202,6 @@ int main(int argc, char** argv)
NdbShutdown(NST_Normal);
- socket_server.stopServer();
- socket_server.stopSessions();
-
- globalTransporterRegistry.stop_clients();
-
return NRT_Default;
}
diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp
index 068610b6778..d6ed6c0dafd 100644
--- a/ndb/src/kernel/vm/Emulator.cpp
+++ b/ndb/src/kernel/vm/Emulator.cpp
@@ -68,6 +68,7 @@ EmulatorData::EmulatorData(){
theThreadConfig = 0;
theSimBlockList = 0;
theShutdownMutex = 0;
+ m_socket_server = 0;
}
void
@@ -83,6 +84,7 @@ EmulatorData::create(){
theWatchDog = new WatchDog();
theThreadConfig = new ThreadConfig();
theSimBlockList = new SimBlockList();
+ m_socket_server = new SocketServer();
theShutdownMutex = NdbMutex_Create();
@@ -99,7 +101,8 @@ EmulatorData::destroy(){
delete theThreadConfig; theThreadConfig = 0;
if(theSimBlockList)
delete theSimBlockList; theSimBlockList = 0;
-
+ if(m_socket_server)
+ delete m_socket_server; m_socket_server = 0;
NdbMem_Destroy();
}
@@ -195,9 +198,22 @@ NdbShutdown(NdbShutdownType type,
fclose(outputStream);
#endif
+ /**
+ * Stop all transporter connection attempts and accepts
+ */
+ globalEmulatorData.m_socket_server->stopServer();
+ globalEmulatorData.m_socket_server->stopSessions();
+ globalTransporterRegistry.stop_clients();
+
+ /**
+ * Stop transporter communication with other nodes
+ */
globalTransporterRegistry.stopSending();
globalTransporterRegistry.stopReceiving();
+ /**
+ * Remove all transporters
+ */
globalTransporterRegistry.removeAll();
#ifdef VM_TRACE
diff --git a/ndb/src/kernel/vm/Emulator.hpp b/ndb/src/kernel/vm/Emulator.hpp
index b3c64830802..dba8cb3ab9b 100644
--- a/ndb/src/kernel/vm/Emulator.hpp
+++ b/ndb/src/kernel/vm/Emulator.hpp
@@ -55,7 +55,8 @@ struct EmulatorData {
class WatchDog * theWatchDog;
class ThreadConfig * theThreadConfig;
class SimBlockList * theSimBlockList;
-
+ class SocketServer * m_socket_server;
+
/**
* Constructor
*