[
https://issues.apache.org/jira/browse/DISPATCH-1326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16835104#comment-16835104
]
ASF GitHub Bot commented on DISPATCH-1326:
------------------------------------------
ted-ross commented on pull request #502: DISPATCH-1326 - Handling of anonymous
messages sent to edge routers. …
URL: https://github.com/apache/qpid-dispatch/pull/502#discussion_r281825449
##########
File path: src/router_core/transfer.c
##########
@@ -616,12 +628,46 @@ static void qdr_link_deliver_CT(qdr_core_t *core,
qdr_action_t *action, bool dis
//
if (DEQ_IS_EMPTY(link->undelivered)) {
+ qdr_link_ref_t *temp_rlink = 0;
qdr_address_t *addr = link->owning_addr;
if (!addr && dlv->to_addr) {
qdr_connection_t *conn = link->conn;
if (conn && conn->tenant_space)
qd_iterator_annotate_space(dlv->to_addr, conn->tenant_space,
conn->tenant_space_len);
qd_hash_retrieve(core->addr_hash, dlv->to_addr, (void**) &addr);
+
+ if (!addr) {
+ qd_log(core->log, QD_LOG_INFO, "yoyoma Addr not in address
table %s - %p\n", qd_iterator_copy(dlv->to_addr), (void *)core->addr_hash);
+ //
+ // This is an anonymous delivery but the address that it wants
sent to is
+ // not in this router's address table. We will send this
delivery up the
+ // anonymous link to the interior router (if this is an edge
router).
+ // Only edge routers have a non null core->edge_conn_addr
+ //
+ if (core->edge_conn_addr && link->conn->role !=
QDR_ROLE_EDGE_CONNECTION) {
+ qdr_address_t *sender_address =
core->edge_conn_addr(core->edge_context);
+ if (sender_address) {
+ addr = sender_address;
+ }
+ }
+ }
+ else {
+ //
+ // (core->edge_conn_addr is non-zero ONLY on edge routers. So
there is no need to check if the
+ // core->router_mode is edge.
+ //
+ // The connection on which the delivery arrived should not be
QDR_ROLE_EDGE_CONNECTION because
+ // we do not want to send it back over the same connections
+ //
+ if (core->edge_conn_addr && link->conn->role !=
QDR_ROLE_EDGE_CONNECTION && qdr_is_addr_treatment_multicast(addr)) {
+ qdr_address_t *sender_address =
core->edge_conn_addr(core->edge_context);
+ if (sender_address && sender_address != addr) {
+ temp_rlink = DEQ_HEAD(sender_address->rlinks);
+ if (temp_rlink)
+ DEQ_INSERT_TAIL(addr->rlinks, temp_rlink);
Review comment:
This is inserting the rlink onto addr->rlinks while it is still on the head
of sender_address->rlinks. This is not a safe or valid thing to do. The
reference can't be on two lists at the same time.
----------------------------------------------------------------
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:
[email protected]
> Anonymous messages are released by edge router even if there is a receiver
> for the messages
> -------------------------------------------------------------------------------------------
>
> Key: DISPATCH-1326
> URL: https://issues.apache.org/jira/browse/DISPATCH-1326
> Project: Qpid Dispatch
> Issue Type: Bug
> Components: Container
> Affects Versions: 1.5.0
> Reporter: Ganesh Murthy
> Assignee: Ganesh Murthy
> Priority: Major
> Attachments: E1.conf, I1.conf, simple_send_anon.py
>
>
> Steps to reproduce
> # Start one interior router and one edge router using the attached config
> files
> # Start a receiver using simple_recv.py and connect it to the interior router
> ##
> {noformat}
> python simple_recv.py -m1 --address 0.0.0.0:77778/examples{noformat}
> # Use the attached sender to send an anonymous message to the edge router
> ##
> {noformat}
> python simple_send_anon.py --address 0.0.0.0:5672 -m1{noformat}
> # The message must travel from the edge router to the interior router which
> in turn must forward it to the receiver. Instead the message is released as
> seen in the below frame trace.
>
> {noformat}
> [0x5603df87eb20]: -> SASL
> [0x5603df87eb20]: <- SASL
> [0x5603df87eb20]:0 <- @sasl-mechanisms(64)
> [sasl-server-mechanisms=@PN_SYMBOL[:ANONYMOUS]]
> [0x5603df87eb20]:0 -> @sasl-init(65) [mechanism=:ANONYMOUS,
> initial-response=b"[email protected]"]
> [0x5603df87eb20]:0 <- @sasl-outcome(68) [code=0]
> [0x5603df87eb20]: -> AMQP
> [0x5603df87eb20]:0 -> @open(16)
> [container-id="c99c4867-447c-424a-8b4f-e8a406c71a57", hostname="0.0.0.0",
> channel-max=32767]
> [0x5603df87eb20]:0 -> @begin(17) [next-outgoing-id=0,
> incoming-window=2147483647, outgoing-window=2147483647]
> [0x5603df87eb20]:0 -> @attach(18)
> [name="c99c4867-447c-424a-8b4f-e8a406c71a57-8db0b3b7-ffde-4c99-9d99-ee8f3c0d9efd",
> handle=0, role=false, snd-settle-mode=2, rcv-settle-mode=0,
> source=@source(40) [durable=0, timeout=0, dynamic=false], target=@target(41)
> [durable=0, timeout=0, dynamic=false], initial-delivery-count=0,
> max-message-size=0]
> [0x5603df87eb20]: <- AMQP
> [0x5603df87eb20]:0 <- @open(16) [container-id="Edge_66t2+y4DnWql1Vx",
> max-frame-size=16384, channel-max=32767, idle-time-out=8000,
> offered-capabilities=:"ANONYMOUS-RELAY",
> properties={:product="qpid-dispatch-router", :version="1.8.0-SNAPSHOT",
> :"qd.conn-id"=7}]
> [0x5603df87eb20]:0 <- @begin(17) [remote-channel=0, next-outgoing-id=0,
> incoming-window=2147483647, outgoing-window=2147483647]
> [0x5603df87eb20]:0 <- @attach(18)
> [name="c99c4867-447c-424a-8b4f-e8a406c71a57-8db0b3b7-ffde-4c99-9d99-ee8f3c0d9efd",
> handle=0, role=true, snd-settle-mode=2, rcv-settle-mode=0,
> source=@source(40) [durable=0, expiry-policy=:"session-end", timeout=0,
> dynamic=false], target=@target(41) [durable=0, expiry-policy=:"session-end",
> timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]
> [0x5603df87eb20]:0 <- @flow(19) [next-incoming-id=0,
> incoming-window=2147483647, next-outgoing-id=0, outgoing-window=2147483647,
> handle=0, delivery-count=0, link-credit=250, drain=false]
> [0x5603df87eb20]:0 -> @transfer(20) [handle=0, delivery-id=0,
> delivery-tag=b"1", message-format=0] (53)
> "\x00SpE\x00Ss\xd0\x00\x00\x00\x11\x00\x00\x00\x03S\x01@\xa1\x08examples\x00Sw\xd1\x00\x00\x00\x10\x00\x00\x00\x02\xa1\x08sequenceT\x01"
> [0x5603df87eb20]:0 <- @flow(19) [next-incoming-id=1,
> incoming-window=2147483647, next-outgoing-id=0, outgoing-window=2147483647,
> handle=0, delivery-count=1, link-credit=250, drain=false]
> [0x5603df87eb20]:0 <- @disposition(21) [role=true, first=0, settled=true,
> state=@released(38) []]
> [0x5603df87eb20]:0 -> (EMPTY FRAME)
> [0x5603df87eb20]:0 -> (EMPTY FRAME)
> ^C[gmurthy@localhost examples]$
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]