diff options
| author | Alan Conway <aconway@apache.org> | 2010-08-03 15:33:12 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2010-08-03 15:33:12 +0000 |
| commit | 9e7d3b38762eeb806941ae3fe0e8bdc70561fbe3 (patch) | |
| tree | fd55d91c8e2fd3281707a54f56dcb0de2813bf52 /cpp/src/qpid | |
| parent | 3af9c51bef0768a75ecd417076154fe6a0ae11ce (diff) | |
| download | qpid-python-9e7d3b38762eeb806941ae3fe0e8bdc70561fbe3.tar.gz | |
Disable non-0 session timeouts.
Since session resume is not fully implemented, non-0 session timeouts
are of no use. Moreover the partial implementation causes problems in
a cluster as stale sessions kept alive by a timeout can interfere with
failover and updates.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@981933 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
| -rw-r--r-- | cpp/src/qpid/SessionState.cpp | 5 | ||||
| -rw-r--r-- | cpp/src/qpid/SessionState.h | 4 | ||||
| -rw-r--r-- | cpp/src/qpid/amqp_0_10/SessionHandler.cpp | 2 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/SessionState.cpp | 5 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/SessionState.h | 2 |
5 files changed, 14 insertions, 4 deletions
diff --git a/cpp/src/qpid/SessionState.cpp b/cpp/src/qpid/SessionState.cpp index 4f370c6765..e5019604d2 100644 --- a/cpp/src/qpid/SessionState.cpp +++ b/cpp/src/qpid/SessionState.cpp @@ -95,6 +95,9 @@ SessionState::SendState::SendState() : unflushedSize(), replaySize(), bytesSince SessionState::ReceiveState::ReceiveState() : bytesSinceKnownCompleted() {} +uint32_t SessionState::getTimeout() const { return timeout; } +void SessionState::setTimeout(uint32_t seconds) { timeout = seconds; } + SessionPoint SessionState::senderGetCommandPoint() { return sender.sendPoint; } SequenceSet SessionState::senderGetIncomplete() const { return sender.incomplete; } SessionPoint SessionState::senderGetReplayPoint() const { return sender.replayPoint; } @@ -240,7 +243,7 @@ SessionState::Configuration::Configuration(size_t flush, size_t hard) : replayFlushLimit(flush), replayHardLimit(hard) {} SessionState::SessionState(const SessionId& i, const Configuration& c) - : id(i), timeout(), config(c), stateful(), receiverTrackingDisabled(false) + : id(i), timeout(0), config(c), stateful(false), receiverTrackingDisabled(false) { QPID_LOG(debug, "SessionState::SessionState " << id << ": " << this); } diff --git a/cpp/src/qpid/SessionState.h b/cpp/src/qpid/SessionState.h index da28738546..02853b1143 100644 --- a/cpp/src/qpid/SessionState.h +++ b/cpp/src/qpid/SessionState.h @@ -92,8 +92,8 @@ class SessionState { const SessionId& getId() const { return id; } - uint32_t getTimeout() const { return timeout; } - void setTimeout(uint32_t seconds) { timeout = seconds; } + QPID_COMMON_EXTERN virtual uint32_t getTimeout() const; + QPID_COMMON_EXTERN virtual void setTimeout(uint32_t seconds); bool operator==(const SessionId& other) const { return id == other; } bool operator==(const SessionState& other) const { return id == other.id; } diff --git a/cpp/src/qpid/amqp_0_10/SessionHandler.cpp b/cpp/src/qpid/amqp_0_10/SessionHandler.cpp index 2448e9ef26..b113d49a73 100644 --- a/cpp/src/qpid/amqp_0_10/SessionHandler.cpp +++ b/cpp/src/qpid/amqp_0_10/SessionHandler.cpp @@ -205,7 +205,7 @@ void SessionHandler::handleDetach() { void SessionHandler::requestTimeout(uint32_t t) { checkAttached(); getState()->setTimeout(t); - peer.timeout(t); + peer.timeout(getState()->getTimeout()); } void SessionHandler::timeout(uint32_t t) { diff --git a/cpp/src/qpid/broker/SessionState.cpp b/cpp/src/qpid/broker/SessionState.cpp index be4f8c7b40..426ef190dd 100644 --- a/cpp/src/qpid/broker/SessionState.cpp +++ b/cpp/src/qpid/broker/SessionState.cpp @@ -380,6 +380,11 @@ void SessionState::readyToSend() { Broker& SessionState::getBroker() { return broker; } +// Session resume is not fully implemented so it is useless to set a +// non-0 timeout. Moreover it creates problems in a cluster because +// dead sessions are kept and interfere with failover. +void SessionState::setTimeout(uint32_t) { } + framing::AMQP_ClientProxy& SessionState::getClusterOrderProxy() { return handler->getClusterOrderProxy(); } diff --git a/cpp/src/qpid/broker/SessionState.h b/cpp/src/qpid/broker/SessionState.h index eade93ddaa..3dcb0a62d4 100644 --- a/cpp/src/qpid/broker/SessionState.h +++ b/cpp/src/qpid/broker/SessionState.h @@ -92,6 +92,8 @@ class SessionState : public qpid::SessionState, Broker& getBroker(); + void setTimeout(uint32_t seconds); + /** OutputControl **/ void abort(); void activateOutput(); |
