ChugR opened a new pull request #962: URL: https://github.com/apache/qpid-dispatch/pull/962
Delivery Id is similar to connection id and link id. It will be printed with log statements as a common prefix allowing for easier delivery tracking. Implementation notes: 1. Connection/Link/Delivery Id caching This patch saves the connection id in links and the connection and link ids in the delivery. The these copies are made once at object creation and used as necessary. The cached copies eliminate hunting for the values at log-statement time. The caching is slightly complicated by initial delivery handoff in the adaptors. That handoff is logged as the delivery's connection and link ids are rewritten. For instance: TCP_ADAPTOR (debug) [C1][L1][D121] initial_delivery ownership passed to [C22][L68][D121] Here a TCP_ADAPTOR egress dispatcher on [C1][L1] is passing delivery [D121] to tcp [C22][L68]. The cache strategy may print connection and link ids after the connection or link has disappeared. That's usually not a problem and the strategy eliminates the defensive code required to test if the connection or link still exists. 2. Delivery ids replace printing the address of the delivery Delivery addresses get reused a lot and grepping for them is hard. 3. Common macros to print the connection, link, and delivery ids from a delivery DLV_FMT - the format string defining conn-link-delivery log prefix DLV_ARGS - accessor to get log prefix values from delivery DLV_FMT is a quoted string similar to PRIu64 and PRIu32 and as such must be used outside of quotation marks in the source. DLV_ARGS(dlv) takes an argument which is a pointer to a qd_delivery_t object. A typical usage changes code like this: - qd_log(core->log, QD_LOG_DEBUG, "Delivery decref_CT: dlv:%lx rc:%"PRIu32" link:%"PRIu64" %s", - (long) dlv, ref_count - 1, link_identity, label); + qd_log(core->log, QD_LOG_DEBUG, DLV_FMT" Delivery decref_CT: rc:%"PRIu32" %s", + DLV_ARGS(dlv), ref_count - 1, label); ---------------------------------------------------------------- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org