[ 
https://issues.apache.org/jira/browse/TS-4612?focusedWorklogId=26015&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-26015
 ]

ASF GitHub Bot logged work on TS-4612:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Jul/16 16:26
            Start Date: 26/Jul/16 16:26
    Worklog Time Spent: 10m 
      Work Description: Github user oknet commented on the issue:

    https://github.com/apache/trafficserver/pull/771
  
    @bryancall to review the codes of ClusterHandlerBase.cc 
    ```
     979         thread = eventProcessor.eventthread[ET_CLUSTER][id % 
num_of_cluster_threads];
     980         if (net_vc->thread == thread) {
     981           cluster_connect_state = CLCON_CONN_BIND_OK;
     982           break;
     983         } else {
     984           cluster_connect_state = 
ClusterHandler::CLCON_CONN_BIND_CLEAR;
     985         }
    ```
    
    From my understanding of the code, the codes from L1007 to L1033 means:
    1. the net_vc bind to unmatched thread
    2. It should unbind(L1012-1022) and then rebind(L1024-L1027) to another 
thread
    
    I think the unbind include remove vc from cop_list here.
    because the InactivityCop only push the vc->thread == this_ethread() into 
cop_list, but the vc->thread set to NULL in L1014.
    
    ```
        // Copy the list and use pop() to catch any closes caused by callbacks.
        forl_LL(UnixNetVConnection, vc, nh.open_list)
        {   
          if (vc->thread == this_ethread()) {
            nh.cop_list.push(vc);
          }   
        }
    ```



Issue Time Tracking
-------------------

    Worklog Id:     (was: 26015)
    Time Spent: 3h 20m  (was: 3h 10m)

> Proposal: InactivityCop Optimize
> --------------------------------
>
>                 Key: TS-4612
>                 URL: https://issues.apache.org/jira/browse/TS-4612
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core, Network
>            Reporter: Oknet Xu
>             Fix For: sometime
>
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> By review the processing of InactivityCop::check_inactivity():
> 1. get all local vc from open_list
> 2. put them into cop_list
> 3. check every vc in cop_list if it is already timeouted
> 4. callback vc->handleEvent to close vc if it is timeout
> InactivityCop and NetHandler share one mutex.
> InactivityCop runs every second, NetHandler runs every 10ms, that means 
> Nethandler runs 100 times until next InactivityCop runs.
> if one vc has read/write in a Nethandler call, it is won't be timeout in the 
> next InactivityCop run.
> Thus, if the vc has read/write in Nethandler, we move it out of cop-list then 
> the InactivityCop runs would get better performace.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to