qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [1/2] qpid-proton git commit: PROTON-1766: [cpp] Finish work_queue when connection is freed
Date Tue, 20 Feb 2018 17:49:53 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master f0ea5c7cf -> 233855fce


PROTON-1766: [cpp] Finish work_queue when connection is freed

On final PN_TRANSPORT_CLOSED (with no reconnect) mark the connection's
work_queue finished() to ensure it does not use a freed connection.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/a1da7f2d
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/a1da7f2d
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/a1da7f2d

Branch: refs/heads/master
Commit: a1da7f2d7644c20a83d72e6e08743019c407a9b1
Parents: f0ea5c7
Author: Alan Conway <aconway@redhat.com>
Authored: Mon Feb 19 12:36:14 2018 -0500
Committer: Alan Conway <aconway@redhat.com>
Committed: Tue Feb 20 09:14:35 2018 -0500

----------------------------------------------------------------------
 proton-c/bindings/cpp/src/proactor_container_impl.cpp | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a1da7f2d/proton-c/bindings/cpp/src/proactor_container_impl.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/proactor_container_impl.cpp b/proton-c/bindings/cpp/src/proactor_container_impl.cpp
index f38cf2c..988521c 100644
--- a/proton-c/bindings/cpp/src/proactor_container_impl.cpp
+++ b/proton-c/bindings/cpp/src/proactor_container_impl.cpp
@@ -594,7 +594,12 @@ bool container::impl::handle(pn_event_t* event) {
         // If reconnect is turned on then handle closed on error here with reconnect attempt
         pn_connection_t* c = pn_event_connection(event);
         pn_transport_t* t = pn_event_transport(event);
+        // If we successfully schedule a re-connect then hide the event from
+        // user handlers by returning here.
         if (pn_condition_is_set(pn_transport_condition(t)) && setup_reconnect(c))
return false;
+        // Otherwise, this connection will be freed by the proactor.
+        // Mark its work_queue finished so it won't try to use the freed connection.
+        connection_context::get(c).work_queue_.impl_.get()->finished();
     }
     default:
         break;


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


Mime
View raw message