[jira] [Work logged] (TS-4522) did not check EPIPE on write_to_net_io
[ https://issues.apache.org/jira/browse/TS-4522?focusedWorklogId=26567=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-26567 ] ASF GitHub Bot logged work on TS-4522: -- Author: ASF GitHub Bot Created on: 18/Aug/16 13:36 Start Date: 18/Aug/16 13:36 Worklog Time Spent: 10m Work Description: Github user oknet commented on the issue: https://github.com/apache/trafficserver/pull/701 agree with @jpeach 's comments and code suggestion. With minor modify that only assert on ( r == 0 ) because of (r < 0) means error on write(). Issue Time Tracking --- Worklog Id: (was: 26567) Time Spent: 0.5h (was: 20m) > did not check EPIPE on write_to_net_io > -- > > Key: TS-4522 > URL: https://issues.apache.org/jira/browse/TS-4522 > Project: Traffic Server > Issue Type: Bug > Components: Core, Network >Reporter: Oknet Xu >Assignee: Oknet Xu > Fix For: 7.0.0 > > Time Spent: 0.5h > Remaining Estimate: 0h > > On a closed socket fd: > read(socketfd) return 0 > write(socketfd) return EPIPE > In the write_to_net_io, we check the return value of write() with the same > way to read(). > {code} > if (!r || r == -ECONNRESET) { > {code} > The bug makes no VC_EVENT_EOS callbacked while write_to_net_io, but > VC_EVENT_ERROR instead. > full code here: > {code} > int64_t r = vc->load_buffer_and_write(towrite, buf, total_written, needs); > if (total_written > 0) { > NET_SUM_DYN_STAT(net_write_bytes_stat, total_written); > s->vio.ndone += total_written; > } > // check for errors > if (r <= 0) { // if the socket was not ready,add to WaitList > if (r == -EAGAIN || r == -ENOTCONN) { > NET_INCREMENT_DYN_STAT(net_calls_to_write_nodata_stat); > if ((needs & EVENTIO_WRITE) == EVENTIO_WRITE) { > vc->write.triggered = 0; > nh->write_ready_list.remove(vc); > write_reschedule(nh, vc); > } > if ((needs & EVENTIO_READ) == EVENTIO_READ) { > vc->read.triggered = 0; > nh->read_ready_list.remove(vc); > read_reschedule(nh, vc); > } > return; > } > if (!r || r == -ECONNRESET) { > vc->write.triggered = 0; > write_signal_done(VC_EVENT_EOS, nh, vc); > return; > } > vc->write.triggered = 0; > write_signal_error(nh, vc, (int)-total_written); > return; > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4522) did not check EPIPE on write_to_net_io
[ https://issues.apache.org/jira/browse/TS-4522?focusedWorklogId=26558=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-26558 ] ASF GitHub Bot logged work on TS-4522: -- Author: ASF GitHub Bot Created on: 18/Aug/16 00:32 Start Date: 18/Aug/16 00:32 Worklog Time Spent: 10m Work Description: Github user zwoop commented on the issue: https://github.com/apache/trafficserver/pull/701 @oknet ping ? Issue Time Tracking --- Worklog Id: (was: 26558) Time Spent: 20m (was: 10m) > did not check EPIPE on write_to_net_io > -- > > Key: TS-4522 > URL: https://issues.apache.org/jira/browse/TS-4522 > Project: Traffic Server > Issue Type: Bug > Components: Core, Network >Reporter: Oknet Xu >Assignee: Oknet Xu > Fix For: 7.0.0 > > Time Spent: 20m > Remaining Estimate: 0h > > On a closed socket fd: > read(socketfd) return 0 > write(socketfd) return EPIPE > In the write_to_net_io, we check the return value of write() with the same > way to read(). > {code} > if (!r || r == -ECONNRESET) { > {code} > The bug makes no VC_EVENT_EOS callbacked while write_to_net_io, but > VC_EVENT_ERROR instead. > full code here: > {code} > int64_t r = vc->load_buffer_and_write(towrite, buf, total_written, needs); > if (total_written > 0) { > NET_SUM_DYN_STAT(net_write_bytes_stat, total_written); > s->vio.ndone += total_written; > } > // check for errors > if (r <= 0) { // if the socket was not ready,add to WaitList > if (r == -EAGAIN || r == -ENOTCONN) { > NET_INCREMENT_DYN_STAT(net_calls_to_write_nodata_stat); > if ((needs & EVENTIO_WRITE) == EVENTIO_WRITE) { > vc->write.triggered = 0; > nh->write_ready_list.remove(vc); > write_reschedule(nh, vc); > } > if ((needs & EVENTIO_READ) == EVENTIO_READ) { > vc->read.triggered = 0; > nh->read_ready_list.remove(vc); > read_reschedule(nh, vc); > } > return; > } > if (!r || r == -ECONNRESET) { > vc->write.triggered = 0; > write_signal_done(VC_EVENT_EOS, nh, vc); > return; > } > vc->write.triggered = 0; > write_signal_error(nh, vc, (int)-total_written); > return; > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4522) did not check EPIPE on write_to_net_io
[ https://issues.apache.org/jira/browse/TS-4522?focusedWorklogId=25962=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25962 ] ASF GitHub Bot logged work on TS-4522: -- Author: ASF GitHub Bot Created on: 23/Jul/16 16:04 Start Date: 23/Jul/16 16:04 Worklog Time Spent: 10m Work Description: Github user zwoop commented on the issue: https://github.com/apache/trafficserver/pull/701 @oknet How do you want to proceed with this? Are you making an update to the PR to address some of the review suggestions? Issue Time Tracking --- Worklog Id: (was: 25962) Time Spent: 10m Remaining Estimate: 0h > did not check EPIPE on write_to_net_io > -- > > Key: TS-4522 > URL: https://issues.apache.org/jira/browse/TS-4522 > Project: Traffic Server > Issue Type: Bug > Components: Core, Network >Reporter: Oknet Xu >Assignee: Oknet Xu > Fix For: 7.0.0 > > Time Spent: 10m > Remaining Estimate: 0h > > On a closed socket fd: > read(socketfd) return 0 > write(socketfd) return EPIPE > In the write_to_net_io, we check the return value of write() with the same > way to read(). > {code} > if (!r || r == -ECONNRESET) { > {code} > The bug makes no VC_EVENT_EOS callbacked while write_to_net_io, but > VC_EVENT_ERROR instead. > full code here: > {code} > int64_t r = vc->load_buffer_and_write(towrite, buf, total_written, needs); > if (total_written > 0) { > NET_SUM_DYN_STAT(net_write_bytes_stat, total_written); > s->vio.ndone += total_written; > } > // check for errors > if (r <= 0) { // if the socket was not ready,add to WaitList > if (r == -EAGAIN || r == -ENOTCONN) { > NET_INCREMENT_DYN_STAT(net_calls_to_write_nodata_stat); > if ((needs & EVENTIO_WRITE) == EVENTIO_WRITE) { > vc->write.triggered = 0; > nh->write_ready_list.remove(vc); > write_reschedule(nh, vc); > } > if ((needs & EVENTIO_READ) == EVENTIO_READ) { > vc->read.triggered = 0; > nh->read_ready_list.remove(vc); > read_reschedule(nh, vc); > } > return; > } > if (!r || r == -ECONNRESET) { > vc->write.triggered = 0; > write_signal_done(VC_EVENT_EOS, nh, vc); > return; > } > vc->write.triggered = 0; > write_signal_error(nh, vc, (int)-total_written); > return; > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)