[
https://issues.apache.org/jira/browse/TS-4387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15261206#comment-15261206
]
ASF GitHub Bot commented on TS-4387:
------------------------------------
Github user shenzhang920 commented on the pull request:
https://github.com/apache/trafficserver/pull/603#issuecomment-215265241
Description:
When calling TSContSchedule()/TSContScheduleEvery(), the passed in
parameter TSCont have to have MUTEX; otherwise if we call
TSContSchedule()/TSContScheduleEvery() more than once using same TSCont, only
the first call will take effect; all the following schedule are ignored due to
MUTEX issue.
Root casue:
The first time calling TSHttpSchedule() with TSCont A (and TSCont A doesn't
have a mutex), it creates Event A, assign thread A; while calling
EThread::schedule(), e->continuation->mutex is NULL, so "e->mutex =
e->continuation->mutex = e->ethread->mutex;" is executed.
Now Event A's mutex = TSCont A's mutex = thread A's mutex
The second time calling TSHttpSchedule() with TSCont A, it creates Event B,
assign thread B;
while calling EThread::schedule(), e->continuation->mutex is NOT NULL, so
"e->mutex = e->continuation->mutex;" is executed.
Now Event B's mutex = TSCont A's mutex (which actually is Event A's mutex)
Eventually, EventA and EventB use a same mutex which causes the second
scheduling get ignored.
> Add enforcement of TSCont having MUTEX when passed to
> TSContSchedule()/TSContScheduleEvery()
> --------------------------------------------------------------------------------------------
>
> Key: TS-4387
> URL: https://issues.apache.org/jira/browse/TS-4387
> Project: Traffic Server
> Issue Type: Bug
> Reporter: Shen Zhang
> Assignee: Brian Geffon
> Fix For: 7.0.0
>
>
> When calling TSContSchedule()/TSContScheduleEvery(), the passed in parameter
> TSCont have to have MUTEX; otherwise if we call
> TSContSchedule()/TSContScheduleEvery() more than once using same TSCont, only
> the first call will take effect; all the following schedule are ignored due
> to MUTEX issue.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)