diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2009-06-01 22:30:24 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2009-06-01 22:30:24 +0000 |
| commit | 17119fd4e7d62f27eb917ed5baa8b9f52e64a654 (patch) | |
| tree | 3184f4ed08dd59b80eecf39c28fff5e327c74f96 /qpid/cpp/src | |
| parent | bf3ef8a406b298cf0f2d8c8f2c622ec9b6fbc510 (diff) | |
| download | qpid-python-17119fd4e7d62f27eb917ed5baa8b9f52e64a654.tar.gz | |
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
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@780855 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/client/ConnectionImpl.cpp | 11 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp | 5 | ||||
| -rw-r--r-- | qpid/cpp/src/tests/cluster.mk | 4 |
3 files changed, 11 insertions, 9 deletions
diff --git a/qpid/cpp/src/qpid/client/ConnectionImpl.cpp b/qpid/cpp/src/qpid/client/ConnectionImpl.cpp index ccaa8c0b87..2fdf4d1d25 100644 --- a/qpid/cpp/src/qpid/client/ConnectionImpl.cpp +++ b/qpid/cpp/src/qpid/client/ConnectionImpl.cpp @@ -130,7 +130,10 @@ public: } }; -static IOThread io(SystemInfo::concurrency()); +IOThread& theIO() { + static IOThread io(SystemInfo::concurrency()); + return io; +} class HeartbeatTask : public TimerTask { TimeoutHandler& timeout; @@ -173,7 +176,7 @@ ConnectionImpl::~ConnectionImpl() { // 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 @@ void ConnectionImpl::open() 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); diff --git a/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp b/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp index 42a2b2bbab..5a6b8987ec 100644 --- a/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp +++ b/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp @@ -258,7 +258,7 @@ class PollerPrivate { // 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 @@ class PollerPrivate { ::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 @@ bool Poller::interrupt(PollerHandle& handle) { ::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()) { diff --git a/qpid/cpp/src/tests/cluster.mk b/qpid/cpp/src/tests/cluster.mk index 3e75d0bf87..6d680f361e 100644 --- a/qpid/cpp/src/tests/cluster.mk +++ b/qpid/cpp/src/tests/cluster.mk @@ -49,8 +49,6 @@ EXTRA_DIST += \ cluster.py -unit_test_LDADD += ../cluster.la - LONG_TESTS += \ start_cluster \ cluster_python_tests \ @@ -66,7 +64,7 @@ cluster_test_SOURCES = \ 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 |
