[
https://issues.apache.org/jira/browse/TS-5076?focusedWorklogId=32849&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-32849
]
ASF GitHub Bot logged work on TS-5076:
--------------------------------------
Author: ASF GitHub Bot
Created on: 03/Dec/16 05:13
Start Date: 03/Dec/16 05:13
Worklog Time Spent: 10m
Work Description: GitHub user oknet opened a pull request:
https://github.com/apache/trafficserver/pull/1243
TS-5076: Test and set the in_enabled_list by atomic function
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/oknet/trafficserver TS-5076
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/trafficserver/pull/1243.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1243
----
commit f2ccc8d78fc753999f26425edc79708f9cc9f380
Author: Oknet Xu <[email protected]>
Date: 2016-12-03T05:07:38Z
TS-5076: Test and set the in_enabled_list by atomic function
----
Issue Time Tracking
-------------------
Worklog Id: (was: 32849)
Time Spent: 10m
Remaining Estimate: 0h
> NetVC is lost from read or write enable_list
> --------------------------------------------
>
> Key: TS-5076
> URL: https://issues.apache.org/jira/browse/TS-5076
> Project: Traffic Server
> Issue Type: Bug
> Components: Core
> Reporter: Oknet Xu
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The related code here:
> {code}
> void
> UnixNetVConnection::reenable(VIO *vio)
> {
> if (STATE_FROM_VIO(vio)->enabled)
> return;
> set_enabled(vio);
> if (!thread)
> return;
> EThread *t = vio->mutex->thread_holding;
> ink_assert(t == this_ethread());
> ink_release_assert(!closed);
> if (nh->mutex->thread_holding == t) {
> ...
> MUTEX_TRY_LOCK(lock, nh->mutex, t);
> if (!lock.is_locked()) {
> if (vio == &read.vio) {
> if (!read.in_enabled_list) { // -----------> the condition check
> is not atomic
> read.in_enabled_list = 1; // -----------> the variable set is not
> atomic
> nh->read_enable_list.push(this);
> }
> } else {
> if (!write.in_enabled_list) { // -----------> the write side
> write.in_enabled_list = 1; // -----------> the write side
> nh->write_enable_list.push(this);
> }
> }
> if (nh->trigger_event && nh->trigger_event->ethread->signal_hook)
> nh->trigger_event->ethread->signal_hook(nh->trigger_event->ethread);
> } else {
> ...
> }
> }
> }
> {code}
> Due to the unstable condition check code, the nh->read_enable_list.push(this)
> would push a netvc into atomic queue that is already inside a queue.
> It leads the elements in atomic queue after the netvc will be lost.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)