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

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

Github user kgiusti commented on a diff in the pull request:

    https://github.com/apache/qpid-dispatch/pull/359#discussion_r212738886
  
    --- Diff: src/router_core/route_control.c ---
    @@ -189,37 +189,40 @@ static void qdr_link_route_activate_CT(qdr_core_t 
*core, qdr_link_route_t *lr, q
         // activation for this address, notify the router module of the added 
address.
         //
         if (lr->addr) {
    +        lr->active_ct += 1;
             qdr_add_connection_ref(&lr->addr->conns, conn);
    -        if (DEQ_SIZE(lr->addr->conns) == 1) {
    +        if (lr->active_ct == 1) {
                 address = qdr_link_route_pattern_to_address(lr->pattern, 
lr->dir);
                 qd_log(core->log, QD_LOG_TRACE, "Activating link route pattern 
[%s]", address);
                 qdr_post_mobile_added_CT(core, address);
                 free(address);
             }
         }
    -
    -    lr->active = true;
     }
     
     
    +// note that this function may free the qdr_link_route_t
     static void qdr_link_route_deactivate_CT(qdr_core_t *core, 
qdr_link_route_t *lr, qdr_connection_t *conn)
     {
         qdr_route_log_CT(core, "Link Route Deactivated", lr->name, 
lr->identity, conn);
     
         //
         // Deactivate the address(es) for link-routed destinations.
         //
    -    if (lr->addr) {
    -        qdr_del_connection_ref(&lr->addr->conns, conn);
    -        if (DEQ_IS_EMPTY(lr->addr->conns)) {
    +    if (lr->addr && qdr_del_connection_ref(&lr->addr->conns, conn)) {
    +        assert(lr->active_ct > 0);
    +        lr->active_ct -= 1;
    +        if (lr->active_ct == 0) {
                 char *address = qdr_link_route_pattern_to_address(lr->pattern, 
lr->dir);
                 qd_log(core->log, QD_LOG_TRACE, "Deactivating link route 
pattern [%s]", address);
    --- End diff --
    
    not at that point, no.  If the lr is not configured delete-on-close then 
the lr is simply deactivated (not deleted) at that point.
    
    if the lr is delete-on-close it will deactivate first, then the call to 
qdr_route_del_link_route_CT will log a trace message that the link route has 
been removed.


> Allow link routes to auto delete when the corresponding container is removed
> ----------------------------------------------------------------------------
>
>                 Key: DISPATCH-1100
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-1100
>             Project: Qpid Dispatch
>          Issue Type: New Feature
>          Components: Management Agent, Router Node
>    Affects Versions: 1.2.0
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>            Priority: Minor
>             Fix For: 1.4.0
>
>
> This would allow a server to create its own link route which is removed when 
> the server is no longer attached to the router.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to