]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Sun, 26 Jun 2005 22:16:18 +0000 (22:16 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Sun, 26 Jun 2005 22:16:18 +0000 (22:16 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@340 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/mds/MDCache.cc
ceph/msg/TCPMessenger.cc
ceph/osd/OSD.cc

index 8868e7e1a8509aec11f48728e2a6cba524b9a48e..3cc376027a22642c7348086c1c7381c5cb08e7ba 100644 (file)
@@ -669,8 +669,8 @@ bool MDCache::shutdown_pass()
   }
        
   // done!
+  dout(7) << "done, sending shutdown_finish" << endl;
   if (mds->get_nodeid() != 0) {
-       dout(7) << "done, sending shutdown_finish" << endl;
        mds->messenger->send_message(new MGenericMessage(MSG_MDS_SHUTDOWNFINISH),
                                                                 MSG_ADDR_MDS(0), MDS_PORT_MAIN, MDS_PORT_MAIN);
   } else {
index 8f990627f29e60dedae063569424324e2ad37fbf..1d87a5ece5966c8cb974e2df883b404c7d98d268 100644 (file)
@@ -155,9 +155,12 @@ int tcpmessenger_init(int& argc, char**& argv)
   //  for (int i=0; i<mpi_world; i++) 
   //dout(DBL) << "  addr of " << i << " is " << remote_addr[i] << endl;
 
-
+  dout(DBL) << "tcpmessenger_shutdown barrier" << endl;
+  MPI_Barrier (MPI_COMM_WORLD);
   MPI_Finalize();
 
+
+  // init socket arrays
   in_sd = new int[mpi_world];
   memset(in_sd, 0, sizeof(int)*mpi_world);
   out_sd = new int[mpi_world];
@@ -173,7 +176,7 @@ int tcpmessenger_init(int& argc, char**& argv)
 
 int tcpmessenger_shutdown() 
 {
-  dout(5) << "tcpmessenger_shutdown closing all sockets etc" << endl;
+  dout(1) << "tcpmessenger_shutdown closing all sockets etc" << endl;
 
   // bleh
   for (int i=0; i<mpi_world; i++) {
@@ -576,6 +579,7 @@ void tcpmessenger_wait()
   dout(10) << "tcpmessenger_wait waiting for thread to finished." << endl;
   pthread_join(dispatch_thread_id, &returnval);
   dout(10) << "tcpmessenger_wait thread finished." << endl;
+
 }
 
 
@@ -635,7 +639,7 @@ int TCPMessenger::shutdown()
 
   // last one?
   if (directory.empty()) {
-       dout(10) << "shutdown last tcpmessenger on rank " << mpi_rank << " shut down" << endl;
+       dout(1) << "shutdown last tcpmessenger on rank " << mpi_rank << " shut down" << endl;
        pthread_t whoami = pthread_self();
 
 
@@ -652,9 +656,14 @@ int TCPMessenger::shutdown()
 
        dout(DBL) << "setting tcp_done" << endl;
 
+       incoming_lock.Lock();
        tcp_done = true;
-       tcpmessenger_kick_incoming_loop();
+       incoming_cond.Signal();
+       incoming_lock.Unlock();
+
        tcpmessenger_kick_outgoing_loop();
+
+
        /*
 
        dout(15) << "whoami = " << whoami << ", thread = " << dispatch_thread_id << endl;
index 3c69e3ea9b73b39dd4fa25b27d6f19f0cd327814..f2927f6b1e64b2536c17b2405287b9fa2bd1d2c9 100644 (file)
@@ -110,8 +110,16 @@ int OSD::init()
 
 int OSD::shutdown()
 {
+  dout(1) << "shutdown" << endl;
+
+  // stop threads
+  delete threadpool;
+  threadpool = 0;
+
+  // shut everything else down
   monitor->shutdown();
   messenger->shutdown();
+
   int r = store->finalize();
   return r;
 }