You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2019/03/25 21:03:43 UTC

[qpid-cpp] branch master updated (c5b29de -> aca4aa3)

This is an automated email from the ASF dual-hosted git repository.

gsim pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-cpp.git.


    from c5b29de  QPID-8278: fix missing extern symbol for Windows builds
     new b1f7154  QPID-8287: avoid call holding lock
     new 8ed016c  QPID-8288: ensure closed is notified without waiting for deletion of connection
     new aca4aa3  NO-JIRA: fix test to not prompt for password

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/qpid/broker/amqp_0_10/Connection.cpp | 10 +++++++++-
 src/qpid/broker/amqp_0_10/Connection.h   |  1 +
 src/qpid/ha/QueueReplicator.cpp          | 18 +++++++++++++++++-
 src/qpid/ha/QueueReplicator.h            |  2 ++
 src/tests/run_ssl_tests                  |  4 ++--
 5 files changed, 31 insertions(+), 4 deletions(-)


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


[qpid-cpp] 02/03: QPID-8288: ensure closed is notified without waiting for deletion of connection

Posted by gs...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gsim pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-cpp.git

commit 8ed016c6bba566e257d72ae3938b4cab34e8778f
Author: Gordon Sim <gs...@redhat.com>
AuthorDate: Tue Mar 19 14:06:59 2019 +0000

    QPID-8288: ensure closed is notified without waiting for deletion of connection
---
 src/qpid/broker/amqp_0_10/Connection.cpp | 10 +++++++++-
 src/qpid/broker/amqp_0_10/Connection.h   |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/qpid/broker/amqp_0_10/Connection.cpp b/src/qpid/broker/amqp_0_10/Connection.cpp
index 4682c1f..7d335c9 100644
--- a/src/qpid/broker/amqp_0_10/Connection.cpp
+++ b/src/qpid/broker/amqp_0_10/Connection.cpp
@@ -139,6 +139,7 @@ Connection::Connection(ConnectionOutputHandler* out_,
     heartbeat(0),
     heartbeatmax(120),
     isDefaultRealm(false),
+    hasSignalledClosed(false),
     securitySettings(external),
     link(link_),
     adapter(*this, link),
@@ -180,7 +181,10 @@ Connection::~Connection()
             << " rhost:" << mgmtId );
         mgmtObject->resourceDestroy();
     }
-    broker.getConnectionObservers().closed(*this);
+    if (!hasSignalledClosed) {
+        broker.getConnectionObservers().closed(*this);
+        hasSignalledClosed = true;
+    }
 
     if (heartbeatTimer)
         heartbeatTimer->cancel();
@@ -376,6 +380,10 @@ void Connection::closed(){ // Physically closed, suspend open sessions.
         QPID_LOG(error, QPID_MSG("While closing connection: " << e.what()));
         assert(0);
     }
+    if (!hasSignalledClosed) {
+        broker.getConnectionObservers().closed(*this);
+        hasSignalledClosed = true;
+    }
 }
 
 void Connection::doIoCallbacks() {
diff --git a/src/qpid/broker/amqp_0_10/Connection.h b/src/qpid/broker/amqp_0_10/Connection.h
index 8fff520..719683d 100644
--- a/src/qpid/broker/amqp_0_10/Connection.h
+++ b/src/qpid/broker/amqp_0_10/Connection.h
@@ -196,6 +196,7 @@ class Connection : public sys::ConnectionInputHandler, public qpid::broker::Conn
     std::vector<Url> knownHosts;
     std::string userName;
     bool isDefaultRealm;
+    bool hasSignalledClosed;
 
     typedef boost::ptr_map<framing::ChannelId, SessionHandler> ChannelMap;
 


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


[qpid-cpp] 03/03: NO-JIRA: fix test to not prompt for password

Posted by gs...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gsim pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-cpp.git

commit aca4aa3c180b5abc46040b527a8bf6fbb415f1cc
Author: Gordon Sim <gs...@redhat.com>
AuthorDate: Mon Mar 25 20:30:04 2019 +0000

    NO-JIRA: fix test to not prompt for password
---
 src/tests/run_ssl_tests | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tests/run_ssl_tests b/src/tests/run_ssl_tests
index cc37db1..4f89654 100755
--- a/src/tests/run_ssl_tests
+++ b/src/tests/run_ssl_tests
@@ -80,13 +80,13 @@ create_certs() {
     #
     certutil -R -d ${CERT_DB} -s "${CERT_SUBJECT}" -o ${TEST_CERT_DIR}/server.req -f ${CERT_PW_FILE} -z /bin/sh > /dev/null 2>&1
     certutil -C -d ${CERT_DB} -c "Test-CA" -8 "${CERT_SAN}" -i ${TEST_CERT_DIR}/server.req -o ${TEST_CERT_DIR}/server.crt -f ${CERT_PW_FILE} -m ${RANDOM}
-    certutil -A -d ${CERT_DB} -n ${TEST_HOSTNAME} -i ${TEST_CERT_DIR}/server.crt -t "Pu,,"  >/dev/null 2>&1
+    certutil -A -d ${CERT_DB} -n ${TEST_HOSTNAME} -i ${TEST_CERT_DIR}/server.crt -t "Pu,,"  -f ${CERT_PW_FILE} >/dev/null 2>&1
 
     # create a certificate to identify the client
     #
     certutil -R -d ${CERT_DB} -s "CN=${TEST_CLIENT_CERT}" -o ${TEST_CERT_DIR}/client.req -f ${CERT_PW_FILE} -z /bin/sh > /dev/null 2>&1
     certutil -C -d ${CERT_DB} -c "Test-CA" -8 "*.client.com" -i ${TEST_CERT_DIR}/client.req -o ${TEST_CERT_DIR}/client.crt -f ${CERT_PW_FILE} -m ${RANDOM}
-    certutil -A -d ${CERT_DB} -n ${TEST_CLIENT_CERT} -i ${TEST_CERT_DIR}/client.crt -t "Pu,,"  >/dev/null 2>&1
+    certutil -A -d ${CERT_DB} -n ${TEST_CLIENT_CERT} -i ${TEST_CERT_DIR}/client.crt -t "Pu,,"  -f ${CERT_PW_FILE} >/dev/null 2>&1
     ###
     #certutil -N -d ${SERVER_CERT_DIR} -f ${CERT_PW_FILE}
     #certutil -S -d ${SERVER_CERT_DIR} -n ${TEST_HOSTNAME} -s "CN=${TEST_HOSTNAME}" -t "CT,," -x -f ${CERT_PW_FILE} -z /usr/bin/certutil


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


[qpid-cpp] 01/03: QPID-8287: avoid call holding lock

Posted by gs...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gsim pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-cpp.git

commit b1f7154e183d90083a79dbe6ba9b58d2e3134def
Author: Gordon Sim <gs...@redhat.com>
AuthorDate: Mon Mar 25 19:00:10 2019 +0000

    QPID-8287: avoid call holding lock
---
 src/qpid/ha/QueueReplicator.cpp | 18 +++++++++++++++++-
 src/qpid/ha/QueueReplicator.h   |  2 ++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/qpid/ha/QueueReplicator.cpp b/src/qpid/ha/QueueReplicator.cpp
index c0d2689..21d0801 100644
--- a/src/qpid/ha/QueueReplicator.cpp
+++ b/src/qpid/ha/QueueReplicator.cpp
@@ -241,12 +241,28 @@ void QueueReplicator::destroy(Mutex::ScopedLock&) {
     getBroker()->getExchanges().destroy(getName());
 }
 
+boost::shared_ptr<QueueSnapshot> QueueReplicator::getSnapshot()
+{
+    boost::shared_ptr<broker::Queue> q;
+    {
+        Mutex::ScopedLock l(lock);
+        if (queue) {
+            q = queue;
+        } else {
+            return boost::shared_ptr<QueueSnapshot>();
+        }
+    }
+    return q->getObservers().findType<QueueSnapshot>();
+}
+
 
 // Called in a broker connection thread when the bridge is created.
 // Note: called with the Link lock held.
 void QueueReplicator::initializeBridge(Bridge& bridge, SessionHandler& sessionHandler_) {
+    boost::shared_ptr<QueueSnapshot> qs = getSnapshot();//do outside the lock
     Mutex::ScopedLock l(lock);
     if (!queue) return;         // Already destroyed
+
     sessionHandler = &sessionHandler_;
     if (sessionHandler->getSession()) {
         // Don't overwrite the exchange property set on the primary.
@@ -258,7 +274,6 @@ void QueueReplicator::initializeBridge(Bridge& bridge, SessionHandler& sessionHa
     arguments.setString(ReplicatingSubscription::QPID_REPLICATING_SUBSCRIPTION, getType());
     arguments.setInt(QPID_SYNC_FREQUENCY, 1); // TODO aconway 2012-05-22: optimize?
     arguments.setTable(ReplicatingSubscription::QPID_BROKER_INFO, brokerInfo.asFieldTable());
-    boost::shared_ptr<QueueSnapshot> qs = queue->getObservers().findType<QueueSnapshot>();
     ReplicationIdSet snapshot;
     if (qs) {
         snapshot = qs->getSnapshot();
@@ -307,6 +322,7 @@ void QueueReplicator::dequeueEvent(const string& data, Mutex::ScopedLock&) {
             if (j == positions.end()) continue;
             position = j->second;
         }
+        Mutex::ScopedUnlock u(lock);//this method is called under lock, so need to release
         queue->dequeueMessageAt(position); // Outside lock, will call dequeued().
         // positions will be cleaned up in dequeued()
     }
diff --git a/src/qpid/ha/QueueReplicator.h b/src/qpid/ha/QueueReplicator.h
index a4b31b6..6260b45 100644
--- a/src/qpid/ha/QueueReplicator.h
+++ b/src/qpid/ha/QueueReplicator.h
@@ -46,6 +46,7 @@ class ExchangeRegistry;
 
 namespace ha {
 class HaBroker;
+class QueueSnapshot;
 class Settings;
 
 /**
@@ -130,6 +131,7 @@ class QueueReplicator : public broker::Exchange,
     class QueueObserver;
 
     void initializeBridge(broker::Bridge& bridge, broker::SessionHandler& sessionHandler);
+    boost::shared_ptr<QueueSnapshot> getSnapshot();
 
     // Dispatch functions
     void dequeueEvent(const std::string& data, sys::Mutex::ScopedLock&);


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