You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2009/06/02 00:30:25 UTC

svn commit: r780855 - in /qpid/trunk/qpid/cpp/src: qpid/client/ConnectionImpl.cpp qpid/sys/epoll/EpollPoller.cpp tests/cluster.mk

Author: astitcher
Date: Mon Jun  1 22:30:24 2009
New Revision: 780855

URL: http://svn.apache.org/viewvc?rev=780855&view=rev
Log:
Some fixes to QPID-1879 so that clustering still works:
Change client io threading to be initialised at first use
Stop linking loadable modules with tests
Add some sentinel values so that we can see what happened last

Modified:
    qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp
    qpid/trunk/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp
    qpid/trunk/qpid/cpp/src/tests/cluster.mk

Modified: qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp?rev=780855&r1=780854&r2=780855&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp Mon Jun  1 22:30:24 2009
@@ -130,7 +130,10 @@
     }
 };
 
-static IOThread io(SystemInfo::concurrency());
+IOThread& theIO() {
+    static IOThread io(SystemInfo::concurrency());
+    return io;
+}
 
 class HeartbeatTask : public TimerTask {
     TimeoutHandler& timeout;
@@ -173,7 +176,7 @@
     // is running.
     failover.reset();
     if (connector) connector->close();
-    io.sub();
+    theIO().sub();
 }
 
 void ConnectionImpl::addSession(const boost::shared_ptr<SessionImpl>& session, uint16_t channel)
@@ -217,8 +220,8 @@
     int port = handler.port;
     QPID_LOG(info, "Connecting to " << protocol << ":" << host << ":" << port);
 
-    io.add();
-    connector.reset(Connector::create(protocol, io.poller(), version, handler, this)); 
+    theIO().add();
+    connector.reset(Connector::create(protocol, theIO().poller(), version, handler, this));
     connector->setInputHandler(&handler);
     connector->setShutdownHandler(this);
     connector->connect(host, port);

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp?rev=780855&r1=780854&r2=780855&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp Mon Jun  1 22:30:24 2009
@@ -258,7 +258,7 @@
         // Add always readable fd into our set (but not listening to it yet)
         ::epoll_event epe;
         epe.events = 0;
-        epe.data.u64 = 0;
+        epe.data.u64 = 1;
         QPID_POSIX_CHECK(::epoll_ctl(epollFd, EPOLL_CTL_ADD, alwaysReadableFd, &epe));
     }
 
@@ -285,7 +285,7 @@
         ::epoll_event epe;
         // Not EPOLLONESHOT, so we eventually get all threads
         epe.events = ::EPOLLIN;
-        epe.data.u64 = 0; // Keep valgrind happy
+        epe.data.u64 = 2; // Keep valgrind happy
         QPID_POSIX_CHECK(::epoll_ctl(epollFd, EPOLL_CTL_MOD, alwaysReadableFd, &epe));  
     }
 };
@@ -442,6 +442,7 @@
         ::epoll_event epe;
         epe.events = 0;
         epe.data.u64 = 0; // Keep valgrind happy
+        epe.data.ptr = &eh;
         QPID_POSIX_CHECK(::epoll_ctl(impl->epollFd, EPOLL_CTL_MOD, eh.fd, &epe));
 
         if (eh.isInactive()) {

Modified: qpid/trunk/qpid/cpp/src/tests/cluster.mk
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/cluster.mk?rev=780855&r1=780854&r2=780855&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/cluster.mk (original)
+++ qpid/trunk/qpid/cpp/src/tests/cluster.mk Mon Jun  1 22:30:24 2009
@@ -49,8 +49,6 @@
   	cluster.py
   	
 
-unit_test_LDADD += ../cluster.la
-
 LONG_TESTS += \
 	start_cluster \
 	cluster_python_tests \
@@ -66,7 +64,7 @@
   	ForkedBroker.cpp \
   	PartialFailure.cpp \
   	ClusterFailover.cpp
-cluster_test_LDADD=$(lib_client) ../cluster.la test_store.la -lboost_unit_test_framework
+cluster_test_LDADD=$(lib_client) $(lib_broker) -lboost_unit_test_framework
 
 qpidtest_SCRIPTS += run_cluster_tests cluster.py testlib.py
 



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org