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

ASF GitHub Bot commented on TS-3429:
------------------------------------

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

    https://github.com/apache/trafficserver/pull/576#discussion_r60103328
  
    --- Diff: proxy/InkAPI.cc ---
    @@ -991,7 +991,14 @@ INKContInternal::handle_event(int event, void *edata)
           Warning("INKCont Deletable but not deleted %d", m_event_count);
         }
       } else {
    -    return m_event_func((TSCont)this, (TSEvent)event, edata);
    +    int retval = m_event_func((TSCont)this, (TSEvent)event, edata);
    +    if (event == EVENT_INTERVAL) {
    +      // In the interval case, we must re-increment the m_event_count for
    +      // the next go around.  Otherwise, our event count will go negative.
    +      if (ink_atomic_increment((int *)&this->m_event_count, 1) < 0)
    --- End diff --
    
    I think this would be better as 
    ```C
    ink_release_assert(ink_atomic_increment((int *)&this->m_event_count, 1) < 
0);
    ```
    
    I agree this is a legitimate assertion; it is more helpful to have the 
actual assertion expression in the log.


> TSContScheduleEvery does not increment event count correctly
> ------------------------------------------------------------
>
>                 Key: TS-3429
>                 URL: https://issues.apache.org/jira/browse/TS-3429
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: Bin
>            Assignee: Susan Hinrichs
>             Fix For: 6.2.0
>
>
> TSContScheduleEvery only increments the event count the first time it is 
> scheduled. When the event handler gets invoked, it decrements the event 
> count. So it triggers the assertion at InkAPI.cc:987. 



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

Reply via email to