Author: aconway
Date: Fri Jan 20 15:21:37 2012
New Revision: 1233949

URL: http://svn.apache.org/viewvc?rev=1233949&view=rev
Log:
Revert "QPID-3352: Fix test for failed session to avoid confusion with as yet 
uninitialised session"

This reverts commit r1233083. It caused a test failure
run_federation_tests: federation.FederationTests.test_pull_from_queue_recovery

Modified:
    qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp
    qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.h
    qpid/trunk/qpid/cpp/src/qpid/broker/Bridge.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/Bridge.h
    qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp?rev=1233949&r1=1233948&r2=1233949&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp Fri Jan 20 
15:21:37 2012
@@ -42,7 +42,7 @@ void SessionHandler::checkAttached() {
 SessionHandler::SessionHandler(FrameHandler* out, ChannelId ch)
     : channel(ch, out), peer(channel),
       awaitingDetached(false),
-      sendReady(), receiveReady(), hasFailed(false) {}
+      sendReady(), receiveReady() {}
 
 SessionHandler::~SessionHandler() {}
 
@@ -192,7 +192,6 @@ void SessionHandler::detached(const std:
     awaitingDetached = false;
     if (code != session::DETACH_CODE_NORMAL) {
         sendReady = receiveReady = false;
-        hasFailed = true;
         channelException(convert(code), "session.detached from peer.");
     } else {
         handleDetach();
@@ -331,9 +330,6 @@ void SessionHandler::sendFlush() {
 bool SessionHandler::ready() const {
     return  sendReady && receiveReady;
 }
-bool SessionHandler::failed() const {
-    return hasFailed;
-}
 
 
 }} // namespace qpid::broker

Modified: qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.h
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.h?rev=1233949&r1=1233948&r2=1233949&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.h Fri Jan 20 15:21:37 
2012
@@ -67,8 +67,6 @@ class QPID_COMMON_CLASS_EXTERN SessionHa
 
     /** True if the handler is ready to send and receive */
     QPID_COMMON_EXTERN bool ready() const;
-    /** True if the session has failed with an execution exception */
-    QPID_COMMON_EXTERN bool failed() const;
 
     // Protocol methods
     QPID_COMMON_EXTERN void attach(const std::string& name, bool force);
@@ -113,7 +111,7 @@ class QPID_COMMON_CLASS_EXTERN SessionHa
     framing::AMQP_AllProxy::Session  peer;
     std::string name;
     bool awaitingDetached;
-    bool sendReady, receiveReady, hasFailed;
+    bool sendReady, receiveReady;
 };
 }} // namespace qpid::amqp_0_10
 

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Bridge.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Bridge.cpp?rev=1233949&r1=1233948&r2=1233949&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Bridge.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Bridge.cpp Fri Jan 20 15:21:37 2012
@@ -164,9 +164,10 @@ void Bridge::destroy()
     listener(this);
 }
 
-bool Bridge::hasSessionFailed() const
+bool Bridge::isSessionReady() const
 {
-    return conn->getChannel(id).failed();
+    SessionHandler& sessionHandler = conn->getChannel(id);
+    return sessionHandler.ready();
 }
 
 void Bridge::setPersistenceId(uint64_t pId) const

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Bridge.h
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Bridge.h?rev=1233949&r1=1233948&r2=1233949&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Bridge.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Bridge.h Fri Jan 20 15:21:37 2012
@@ -59,7 +59,7 @@ public:
     void destroy();
     bool isDurable() { return args.i_durable; }
 
-    bool hasSessionFailed() const;
+    bool isSessionReady() const;
 
     management::ManagementObject* GetManagementObject() const;
     management::Manageable::status_t ManagementMethod(uint32_t methodId,

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp?rev=1233949&r1=1233948&r2=1233949&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp Fri Jan 20 15:21:37 2012
@@ -251,7 +251,7 @@ void Link::ioThreadProcessing()
     // check for bridge session errors and recover
     if (!active.empty()) {
         Bridges::iterator removed = std::remove_if(
-            active.begin(), active.end(), 
boost::bind(&Bridge::hasSessionFailed, _1));
+            active.begin(), active.end(), 
!boost::bind(&Bridge::isSessionReady, _1));
         for (Bridges::iterator i = removed; i != active.end(); ++i) {
             Bridge::shared_ptr  bridge = *i;
             bridge->closed();



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to