qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1643276 - in /qpid/trunk/qpid/cpp/src/qpid/messaging/amqp: AddressHelper.cpp SessionContext.cpp
Date Fri, 05 Dec 2014 13:39:28 GMT
Author: aconway
Date: Fri Dec  5 13:39:28 2014
New Revision: 1643276

URL: http://svn.apache.org/r1643276
Log:
QPID-6252: AMQP 1.0 browsing client generates large number of errors on broker (better fix)

This is a simpler and better fix based on the discussion at:

http://qpid.2158936.n2.nabble.com/Re-svn-commit-r1642720-in-qpid-trunk-qpid-cpp-src-qpid-messaging-amqp-AddressHelper-h-ConnectionConth-td7617083.html

The changes are all client-side:
- A browsing address is unreliable by default. An explicit reliability setting is respected.
- The client session does not record pre-settled deliveries in it's unacked list.

So by default:
- Browsing links are unreliable. Broker sends pre-settled, messages are not recorded in unacked
list.
- The user is not required to acknowledge browsed messages for proper clean-up.
- Calling acknowledge() for a browsed message is a no-op, not an error.

If the user explicitly requests a reliable browsing link, then we behave exactly as before.
I can't see any value in doing this with qpidd but maybe with some other broker there might
be
a use for being able to control the accept of browsed messages.

This does affect non-browsing, unreliable links but it is an improvement.
Settling a pre-settled messages is a no-op, so there is no point in recording
pre-settled messages in the unacked list since we do nothing when they are
acknoweldged.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp?rev=1643276&r1=1643275&r2=1643276&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp Fri Dec  5 13:39:28 2014
@@ -571,7 +571,8 @@ bool AddressHelper::enabled(const std::s
 
 bool AddressHelper::isUnreliable() const
 {
-    return reliability == AT_MOST_ONCE || reliability == UNRELIABLE;
+    return reliability == AT_MOST_ONCE || reliability == UNRELIABLE ||
+        (reliability.empty() && browse); // A browser defaults to unreliable.
 }
 
 const qpid::types::Variant::Map& AddressHelper::getNodeProperties() const

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp?rev=1643276&r1=1643275&r2=1643276&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp Fri Dec  5 13:39:28 2014
@@ -113,7 +113,8 @@ uint32_t SessionContext::getUnsettledAck
 qpid::framing::SequenceNumber SessionContext::record(pn_delivery_t* delivery)
 {
     qpid::framing::SequenceNumber id = next++;
-    unacked[id] = delivery;
+    if (!pn_delivery_settled(delivery))
+        unacked[id] = delivery;
     QPID_LOG(debug, "Recorded delivery " << id << " -> " << delivery);
     return id;
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message