[ 
https://issues.apache.org/jira/browse/DISPATCH-1428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16933592#comment-16933592
 ] 

ASF GitHub Bot commented on DISPATCH-1428:
------------------------------------------

kgiusti commented on pull request #567: DISPATCH-1428
URL: https://github.com/apache/qpid-dispatch/pull/567#discussion_r326286986
 
 

 ##########
 File path: src/router_core/route_control.c
 ##########
 @@ -625,9 +595,65 @@ void qdr_route_connection_closed_CT(qdr_core_t *core, 
qdr_connection_t *conn)
         //
         qdr_del_connection_ref(&cid->connection_refs, conn);
 
-        conn->conn_id        = 0;
-
         qdr_route_check_id_for_deletion_CT(core, cid);
+}
+
+void qdr_route_connection_opened_CT(qdr_core_t       *core,
+                                    qdr_connection_t *conn,
+                                    qdr_field_t      *container_field,
+                                    qdr_field_t      *connection_field)
+{
+    if (conn->role != QDR_ROLE_ROUTE_CONTAINER)
+        return;
+
+    if (connection_field) {
+        qdr_conn_identifier_t *cid = qdr_route_declare_id_CT(core, 0, 
connection_field->iterator);
+        qdr_add_connection_ref(&cid->connection_refs, conn);
+        conn->conn_id = cid;
+        activate_route_connection(core, conn, conn->conn_id);
+        if (container_field) {
+            cid = qdr_route_declare_id_CT(core, container_field->iterator, 0);
+            qdr_add_connection_ref(&cid->connection_refs, conn);
 
 Review comment:
   Q: after adding the second connection_ref (616), if the conn_id and the cid 
are equal the new cid is not saved in the conn's alt_conn_id.
   
   Does this leak a cid?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> route connection not indexed by 'connection' field of connector
> ---------------------------------------------------------------
>
>                 Key: DISPATCH-1428
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-1428
>             Project: Qpid Dispatch
>          Issue Type: Bug
>            Reporter: Gordon Sim
>            Priority: Major
>
> The connection established by a route-container connector will not be indexed 
> by the 'connection' field of that connector if there is already an existing 
> route-connection with the same container id but established by a different 
> connector.
> E.g. start router on 5672 and a broker (or a separate router emulating a 
> broker) on 5673, then:
> {noformat}
> for n in foo bar; do
>     qdmanage CREATE --type connector --name $n role=route-container 
> host=localhost port=5673; 
>     qdmanage CREATE --type linkRoute --name $n pattern=$n direction=in 
> connection=$n;
> done;
> qdstat --linkroute
> {noformat}
> Only one of these link routes is active though both connections are 
> established.
> The issues is that when the first connection is established, it indexes the 
> qdr_conn_identifier_t by container-id and the connection label from the 
> connector. When the second connection is established, it looks up first by 
> container id, so adds itself to the qdr_conn_identifier_t created by the 
> first connection. There is then no entry in the index for the connection 
> label of the second connector, so the second link route can never be 
> activated.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to