Skip to content

Commit

Permalink
DEBUG DO NOT MERGE
Browse files Browse the repository at this point in the history
  • Loading branch information
kgiusti committed Oct 11, 2024
1 parent 1bd9a7d commit ae799d8
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/router_core/modules/edge_addr_tracking/edge_addr_tracking.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ static void qdrc_update_edge_peers(qdr_core_t *core, qdr_address_t *addr, bool r
{
qdr_link_ref_t *inlink = DEQ_HEAD(addr->inlinks);

qd_log(LOG_ROUTER_MA, QD_LOG_INFO, "***KAG: UPDATING EDGE WITH %s REACHABLE: %s",
(const char *) qd_hash_key_by_handle(addr->hash_handle),
reachable ? "YES" : "NO");

while (inlink) {
qdr_link_t *link = inlink->link;
if (!!link->edge_context) {
Expand Down Expand Up @@ -307,6 +311,10 @@ static void on_addr_event(void *context, qdrc_event_t event, qdr_address_t *addr
// Otherwise, we need to update all edge peers because edges may have been excluded by being the
// sole destination for the address.
//

qd_log(LOG_ROUTER_MA, QD_LOG_INFO, "***KAG: ADDED LOCAL DEST EVENT: %s",
(const char *) qd_hash_key_by_handle(addr->hash_handle));

if (qd_bitmask_cardinality(addr->rnodes) == 0 || DEQ_SIZE(addr->rlinks) - addr->proxy_rlink_count > 2) {
qdrc_update_edge_peers(addr_tracking->core, addr, true);
}
Expand All @@ -316,6 +324,10 @@ static void on_addr_event(void *context, qdrc_event_t event, qdr_address_t *addr
//
//
//

qd_log(LOG_ROUTER_MA, QD_LOG_INFO, "***KAG: ADDED REMOTE DEST EVENT: %s",
(const char *) qd_hash_key_by_handle(addr->hash_handle));

if (qd_bitmask_cardinality(addr->rnodes) == 1) {
qdrc_update_edge_peers(addr_tracking->core, addr, true);
}
Expand All @@ -333,6 +345,10 @@ static void on_addr_event(void *context, qdrc_event_t event, qdr_address_t *addr

case QDRC_EVENT_ADDR_LOCAL_CHANGED:
case QDRC_EVENT_ADDR_REMOTE_CHANGED:

qd_log(LOG_ROUTER_MA, QD_LOG_INFO, "***KAG: ADDR CHANGE EVENT: %s",
(const char *) qd_hash_key_by_handle(addr->hash_handle));

qdrc_check_edge_peers(addr_tracking->core, addr);
break;

Expand All @@ -348,6 +364,12 @@ static void on_link_event(void *context, qdrc_event_t event, qdr_link_t *link)
{
qdr_addr_tracking_module_context_t *mc = (qdr_addr_tracking_module_context_t*) context;
qdr_address_t *addr = link->owning_addr;


qd_log(LOG_ROUTER_MA, QD_LOG_INFO, "***KAG: LINK EDGE ATTACHED EVENT: %s",
(addr) ? (const char *) qd_hash_key_by_handle(addr->hash_handle)
: "NO ADDR GIVEN");

if (addr && qdr_address_is_mobile_CT(addr) && (DEQ_SIZE(addr->subscriptions) == 0 || addr->propagate_local) && link->link_direction == QD_INCOMING) {
qdr_addr_endpoint_state_t *endpoint_state = qdrc_get_endpoint_state_for_connection(mc->endpoint_state_list, link->conn);
// Fix for DISPATCH-1492. Remove the assert(endpoint_state); and add an if condition check for endpoint_state
Expand Down
30 changes: 30 additions & 0 deletions src/router_core/modules/edge_router/addr_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,9 @@ static void on_transfer(void *link_context,
qcm_edge_addr_proxy_t *ap = (qcm_edge_addr_proxy_t*) link_context;
uint64_t dispo = PN_ACCEPTED;

qd_log(LOG_ROUTER_CORE, QD_LOG_INFO,
"***KAG: ADDRESS UPSTREAM STATUS UPDATE RECEIVED");

//
// Validate the message
//
Expand All @@ -484,6 +487,18 @@ static void on_transfer(void *link_context,
bool dest = qd_parse_as_bool(dest_field);
qdr_address_t *addr;

{
char *addressy_poo = (char *)qd_iterator_copy_const(addr_iter);

qd_log(LOG_ROUTER_CORE, QD_LOG_INFO,
"***KAG: ADDRESS UPSTREAM UPDATE ADDR=%s REACHABLE=%s",
addressy_poo ? addressy_poo : "NO ADDRESS?",
dest ? "YES" : "NO");

free(addressy_poo);

}

qd_iterator_reset_view(addr_iter, ITER_VIEW_ALL);
qd_hash_retrieve(ap->core->addr_hash, addr_iter, (void**) &addr);
if (addr) {
Expand All @@ -492,13 +507,28 @@ static void on_transfer(void *link_context,
if (dest) {
if (link->owning_addr == 0) {
qdr_core_bind_address_link_CT(ap->core, addr, link);
} else {
qd_log(LOG_ROUTER_CORE, QD_LOG_INFO,
"***KAG: ADDRESS UPSTREAM UPDATE FAILED HAS OWNER %s",
(const char *) qd_hash_key_by_handle(link->owning_addr->hash_handle));
}
} else {
if (link->owning_addr == addr) {
qdr_core_unbind_address_link_CT(ap->core, addr, link);
} else {
qd_log(LOG_ROUTER_CORE, QD_LOG_INFO,
"***KAG: ADDRESS UPSTREAM UPDATE FAILED OWNER %p (%s)",
(void *) link->owning_addr,
(link->owning_addr) ? (const char *) qd_hash_key_by_handle(link->owning_addr->hash_handle) : "NO ADDR");
}
}
} else {
qd_log(LOG_ROUTER_CORE, QD_LOG_INFO,
"***KAG: ADDRESS UPSTREAM UPDATE FAILED NO LINK");
}
} else {
qd_log(LOG_ROUTER_CORE, QD_LOG_INFO,
"***KAG: ADDRESS UPSTREAM UPDATE FAILED NO ADDRESS");
}
}
}
Expand Down

0 comments on commit ae799d8

Please sign in to comment.