[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=31167=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31167 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 26/Oct/16 22:41 Start Date: 26/Oct/16 22:41 Worklog Time Spent: 10m Work Description: Github user jacksontj commented on the issue: https://github.com/apache/trafficserver/pull/947 An update to summarize updates from today: After looking into it the core issue with the crash I was seeing is that the read/write side of the VIOs where being called regardless of which side the error came in on. Really we should handle the error on the appropriate side (in or out)-- so instead of allowing us to do the read (for example) when read OR error, this PR changes it so that we only call that routine if it was on the read side. Then within that read handler we can check if there was an error. Secondly, instead of trying to unset the error state in the handler, I'm simply just setting it every time we get into the read/write blocks to the appropriate values. So, the PR is now updated (with the patch I've tested) and ready for merge! Issue Time Tracking --- Worklog Id: (was: 31167) Time Spent: 10h (was: 9h 50m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 10h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=31124=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31124 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 26/Oct/16 20:27 Start Date: 26/Oct/16 20:27 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1090/ for details. Issue Time Tracking --- Worklog Id: (was: 31124) Time Spent: 9h 40m (was: 9.5h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 9h 40m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=31125=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31125 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 26/Oct/16 20:28 Start Date: 26/Oct/16 20:28 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/982/ for details. Issue Time Tracking --- Worklog Id: (was: 31125) Time Spent: 9h 50m (was: 9h 40m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 9h 50m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=31122=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31122 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 26/Oct/16 20:09 Start Date: 26/Oct/16 20:09 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/981/ for details. Issue Time Tracking --- Worklog Id: (was: 31122) Time Spent: 9.5h (was: 9h 20m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 9.5h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=31120=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31120 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 26/Oct/16 20:07 Start Date: 26/Oct/16 20:07 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1089/ for details. Issue Time Tracking --- Worklog Id: (was: 31120) Time Spent: 9h 20m (was: 9h 10m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 9h 20m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=31109=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31109 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 26/Oct/16 19:14 Start Date: 26/Oct/16 19:14 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/979/ for details. Issue Time Tracking --- Worklog Id: (was: 31109) Time Spent: 9h 10m (was: 9h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 9h 10m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=31108=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31108 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 26/Oct/16 19:11 Start Date: 26/Oct/16 19:11 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1087/ for details. Issue Time Tracking --- Worklog Id: (was: 31108) Time Spent: 9h (was: 8h 50m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 9h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=31063=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31063 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 25/Oct/16 21:48 Start Date: 25/Oct/16 21:48 Worklog Time Spent: 10m Work Description: Github user jacksontj commented on the issue: https://github.com/apache/trafficserver/pull/947 After doing some testing with this patch, I see crashes where write_to_net is being called with a null vc lock. ``` (gdb) list 416 } 417 while ((vc = write_ready_list.dequeue())) { 418 if (vc->closed) 419 close_UnixNetVConnection(vc, trigger_event->ethread); 420 else if ((vc->write.enabled && vc->write.triggered) || vc->write.error) 421 write_to_net(this, vc, trigger_event->ethread); 422 else if (!vc->write.enabled) { 423 write_ready_list.remove(vc); ``` Seems that vc->write.error forces write_to_net to be called, but nothing is checking that the vc is non-null. Specifically: ``` (gdb) p lock $1 = {m = {m_ptr = 0x0}, lock_acquired = 157} (gdb) list 382 write_to_net_io(NetHandler *nh, UnixNetVConnection *vc, EThread *thread) 383 { 384 NetState *s = >write; 385 ProxyMutex *mutex = thread->mutex; 386 387 MUTEX_TRY_LOCK_FOR(lock, s->vio.mutex, thread, s->vio._cont); // <-- this line, specifically the s->vio.mutex 388 389 if (!lock.is_locked() || lock.get_mutex() != s->vio.mutex.m_ptr) { 390 write_reschedule(nh, vc); 391 return; ``` Issue Time Tracking --- Worklog Id: (was: 31063) Time Spent: 8h 50m (was: 8h 40m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 8h 50m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=30961=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-30961 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 22/Oct/16 01:05 Start Date: 22/Oct/16 01:05 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/957/ for details. Issue Time Tracking --- Worklog Id: (was: 30961) Time Spent: 8h 40m (was: 8.5h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 8h 40m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=30960=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-30960 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 22/Oct/16 01:00 Start Date: 22/Oct/16 01:00 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1065/ for details. Issue Time Tracking --- Worklog Id: (was: 30960) Time Spent: 8.5h (was: 8h 20m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 8.5h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=30157=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-30157 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 05/Oct/16 03:55 Start Date: 05/Oct/16 03:55 Worklog Time Spent: 10m Work Description: Github user jacksontj commented on the issue: https://github.com/apache/trafficserver/pull/947 @zwoop ping again :) Issue Time Tracking --- Worklog Id: (was: 30157) Time Spent: 8h 20m (was: 8h 10m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 8h 20m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=29477=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29477 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 22/Sep/16 02:19 Start Date: 22/Sep/16 02:19 Worklog Time Spent: 10m Work Description: Github user jacksontj commented on the issue: https://github.com/apache/trafficserver/pull/947 @zwoop ping :) Issue Time Tracking --- Worklog Id: (was: 29477) Time Spent: 8h 10m (was: 8h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 8h 10m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=29241=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29241 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 16/Sep/16 15:30 Start Date: 16/Sep/16 15:30 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/717/ for details. Issue Time Tracking --- Worklog Id: (was: 29241) Time Spent: 8h (was: 7h 50m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 8h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=29240=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29240 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 16/Sep/16 15:28 Start Date: 16/Sep/16 15:28 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/821/ for details. Issue Time Tracking --- Worklog Id: (was: 29240) Time Spent: 7h 50m (was: 7h 40m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 7h 50m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=29239=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29239 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 16/Sep/16 14:41 Start Date: 16/Sep/16 14:41 Worklog Time Spent: 10m Work Description: Github user jacksontj commented on the issue: https://github.com/apache/trafficserver/pull/947 Sure, I ran it in a test env for a few days with no issues, I also have a test case for the RST behavior which is passing as well. Probably worth running on docs just to see if there is anything else, but I don't expect there to be any problems-- as we are only adding handling to a subset of cases which are currently ignored. Issue Time Tracking --- Worklog Id: (was: 29239) Time Spent: 7h 40m (was: 7.5h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.1.0 > > Time Spent: 7h 40m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=29182=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29182 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 15/Sep/16 19:26 Start Date: 15/Sep/16 19:26 Worklog Time Spent: 10m Work Description: Github user jpeach commented on the issue: https://github.com/apache/trafficserver/pull/947 @jacksontj @zwoop Can we please run this on docs for a few days? Issue Time Tracking --- Worklog Id: (was: 29182) Time Spent: 7.5h (was: 7h 20m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.0.0 > > Time Spent: 7.5h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=29150=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29150 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 15/Sep/16 18:15 Start Date: 15/Sep/16 18:15 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/814/ for details. Issue Time Tracking --- Worklog Id: (was: 29150) Time Spent: 7h 20m (was: 7h 10m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.0.0 > > Time Spent: 7h 20m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=29148=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29148 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 15/Sep/16 18:14 Start Date: 15/Sep/16 18:14 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/710/ for details. Issue Time Tracking --- Worklog Id: (was: 29148) Time Spent: 7h 10m (was: 7h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Fix For: 7.0.0 > > Time Spent: 7h 10m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28569=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28569 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 09/Sep/16 04:40 Start Date: 09/Sep/16 04:40 Worklog Time Spent: 10m Work Description: Github user oknet commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/947#discussion_r78128086 --- Diff: iocore/net/UnixNetVConnection.cc --- @@ -270,6 +270,21 @@ read_from_net(NetHandler *nh, UnixNetVConnection *vc, EThread *thread) close_UnixNetVConnection(vc, thread); return; } + + if (vc->read.error) { +int err = 0, errlen = sizeof(int); +if (getsockopt(vc->con.fd, SOL_SOCKET, SO_ERROR, , (socklen_t *)) == -1) { + err = errno; +} +// if it is a non-temporary error, we should die appropriately +if (err != EAGAIN && err != EINTR) { + read_signal_error(nh, vc, err); + return; +} else { + vc->read.error = 0; --- End diff -- Yes, it is not a likely scenario. This case is only a EPOLLERR occur on a socket fd and without EPOLLIN or EPOLLOUT. The EPOLLERR is only indictor an error occur on a socket fd. We can get the errno by getsockopt() for the socket fd directly before perform read() or write(). Issue Time Tracking --- Worklog Id: (was: 28569) Time Spent: 7h (was: 6h 50m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 7h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28567=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28567 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 09/Sep/16 04:24 Start Date: 09/Sep/16 04:24 Worklog Time Spent: 10m Work Description: Github user oknet commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/947#discussion_r78127251 --- Diff: iocore/net/UnixNetVConnection.cc --- @@ -270,6 +270,21 @@ read_from_net(NetHandler *nh, UnixNetVConnection *vc, EThread *thread) close_UnixNetVConnection(vc, thread); return; } + + if (vc->read.error) { --- End diff -- @jacksontj here should be + // if it is not enabled and got error from polling + if (!s->enabled && s->error) { we should do read first if we get both of read enabled and error. e.g.: remote do a shutdown() on socket, we will get EVENTIO_READ and EVENTIO_ERROR here. Issue Time Tracking --- Worklog Id: (was: 28567) Time Spent: 6h 50m (was: 6h 40m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 6h 50m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28566=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28566 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 09/Sep/16 04:23 Start Date: 09/Sep/16 04:23 Worklog Time Spent: 10m Work Description: Github user jpeach commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/947#discussion_r78127223 --- Diff: iocore/net/UnixNetVConnection.cc --- @@ -270,6 +270,21 @@ read_from_net(NetHandler *nh, UnixNetVConnection *vc, EThread *thread) close_UnixNetVConnection(vc, thread); return; } + + if (vc->read.error) { +int err = 0, errlen = sizeof(int); +if (getsockopt(vc->con.fd, SOL_SOCKET, SO_ERROR, , (socklen_t *)) == -1) { + err = errno; +} +// if it is a non-temporary error, we should die appropriately +if (err != EAGAIN && err != EINTR) { + read_signal_error(nh, vc, err); + return; +} else { + vc->read.error = 0; --- End diff -- Yes that's my point. You (probably) had the error but dropped it and maybe now you get EBADF instead. Clearly this is not a likely scenario ... Issue Time Tracking --- Worklog Id: (was: 28566) Time Spent: 6h 40m (was: 6.5h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 6h 40m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28565=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28565 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 09/Sep/16 04:20 Start Date: 09/Sep/16 04:20 Worklog Time Spent: 10m Work Description: Github user oknet commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/947#discussion_r78127044 --- Diff: iocore/net/UnixNetVConnection.cc --- @@ -270,6 +270,21 @@ read_from_net(NetHandler *nh, UnixNetVConnection *vc, EThread *thread) close_UnixNetVConnection(vc, thread); return; } + + if (vc->read.error) { +int err = 0, errlen = sizeof(int); +if (getsockopt(vc->con.fd, SOL_SOCKET, SO_ERROR, , (socklen_t *)) == -1) { + err = errno; +} +// if it is a non-temporary error, we should die appropriately +if (err != EAGAIN && err != EINTR) { + read_signal_error(nh, vc, err); + return; +} else { + vc->read.error = 0; --- End diff -- @jpeach The socket fd is not valid descriptor if getsockopt failed. It is fatal error and we should signal_error to SM and close the NetVC. Issue Time Tracking --- Worklog Id: (was: 28565) Time Spent: 6.5h (was: 6h 20m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 6.5h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28564=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28564 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 09/Sep/16 04:13 Start Date: 09/Sep/16 04:13 Worklog Time Spent: 10m Work Description: Github user oknet commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/947#discussion_r78126610 --- Diff: iocore/net/UnixNetVConnection.cc --- @@ -270,6 +270,21 @@ read_from_net(NetHandler *nh, UnixNetVConnection *vc, EThread *thread) close_UnixNetVConnection(vc, thread); return; } + + if (vc->read.error) { +int err = 0, errlen = sizeof(int); +if (getsockopt(vc->con.fd, SOL_SOCKET, SO_ERROR, , (socklen_t *)) == -1) { + err = errno; +} +// if it is a non-temporary error, we should die appropriately +if (err != EAGAIN && err != EINTR) { + read_signal_error(nh, vc, err); + return; +} else { + vc->read.error = 0; --- End diff -- @jpeach the error clear here. How to handle the EVENTIO_ERROR: 1. Set error to 1 if NetHandler get EVENTIO_ERROR on NetVC 2. Call net_read_io or write_to_net_io for the NetVC that has triggered and enabled or only has error). 3. In the io function, we get lock first then check the vio error status. 4. Try to get socket error by getsockopt if error set 5. clear vio error status if non-fatal error 6. call read|write_signal_error if fatal error and the NetVC should be closed. Issue Time Tracking --- Worklog Id: (was: 28564) Time Spent: 6h 20m (was: 6h 10m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 6h 20m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28563=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28563 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 09/Sep/16 04:05 Start Date: 09/Sep/16 04:05 Worklog Time Spent: 10m Work Description: Github user oknet commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/947#discussion_r78126177 --- Diff: iocore/net/UnixNetVConnection.cc --- @@ -270,6 +270,21 @@ read_from_net(NetHandler *nh, UnixNetVConnection *vc, EThread *thread) close_UnixNetVConnection(vc, thread); return; } + + if (vc->read.error) { +int err = 0, errlen = sizeof(int); +if (getsockopt(vc->con.fd, SOL_SOCKET, SO_ERROR, , (socklen_t *)) == -1) { + err = errno; +} +// if it is a non-temporary error, we should die appropriately +if (err != EAGAIN && err != EINTR) { --- End diff -- here should be if ( err && err != EAGAIN && err != EINTR) @jacksontj Issue Time Tracking --- Worklog Id: (was: 28563) Time Spent: 6h 10m (was: 6h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 6h 10m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28456=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28456 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 08/Sep/16 16:37 Start Date: 08/Sep/16 16:37 Worklog Time Spent: 10m Work Description: Github user jpeach commented on the issue: https://github.com/apache/trafficserver/pull/947 I'm worried by the number of changes here. Has this been tested? What is the risk of regression? Is this known to work on any platform other than Linux? Can we add comments to describe why this is the right approach? I note that ``NetState::error`` is not initialized, which doesn't give me a good feeling :-/ Why do you set ``err`` to be the ``getsockopt`` failure? In most APIs you already had the err at close time. Why is ``NetState::error`` never cleared before doing any I/O? Is the real fix here the fact that errors can trigger a read even when reads are not enabled? What are the consequences of that? If that is the core fix, then I expect we could simplify this. Issue Time Tracking --- Worklog Id: (was: 28456) Time Spent: 6h (was: 5h 50m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 6h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28411=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28411 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 08/Sep/16 06:23 Start Date: 08/Sep/16 06:23 Worklog Time Spent: 10m Work Description: Github user oknet commented on the issue: https://github.com/apache/trafficserver/pull/947 looks good to me. @jpeach, Can you review the finial code ? Issue Time Tracking --- Worklog Id: (was: 28411) Time Spent: 5h 50m (was: 5h 40m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 5h 50m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28303=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28303 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 07/Sep/16 16:52 Start Date: 07/Sep/16 16:52 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/622/ for details. Issue Time Tracking --- Worklog Id: (was: 28303) Time Spent: 5h 40m (was: 5.5h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 5h 40m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28302=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28302 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 07/Sep/16 16:49 Start Date: 07/Sep/16 16:49 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *failed*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/726/ for details. Issue Time Tracking --- Worklog Id: (was: 28302) Time Spent: 5.5h (was: 5h 20m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 5.5h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28296=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28296 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 07/Sep/16 16:32 Start Date: 07/Sep/16 16:32 Worklog Time Spent: 10m Work Description: Github user jacksontj commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/947#discussion_r77858252 --- Diff: iocore/net/UnixNet.cc --- @@ -525,7 +531,17 @@ NetHandler::mainNetEvent(int event, Event *e) close_UnixNetVConnection(vc, trigger_event->ethread); else if (vc->read.enabled && vc->read.triggered) vc->net_read_io(this, trigger_event->ethread); -else if (!vc->read.enabled) { +else if (vc->read.error) { + int err = 0, errlen = sizeof(int); + if (getsockopt(vc->con.fd, SOL_SOCKET, SO_ERROR, , (socklen_t *)) == -1) { +err = errno; + } + if (err != EAGAIN && err != EINTR) { +vc->readSignalError(this, err); --- End diff -- That makes sense :) I've cleaned that up (left it as a separate commit for review-- although before merging I'll squash it). I did test that its still fixing my bug-- and it is, so I think we are set :) Issue Time Tracking --- Worklog Id: (was: 28296) Time Spent: 5h 20m (was: 5h 10m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 5h 20m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28265=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28265 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 07/Sep/16 06:22 Start Date: 07/Sep/16 06:22 Worklog Time Spent: 10m Work Description: Github user oknet commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/947#discussion_r77765559 --- Diff: iocore/net/UnixNet.cc --- @@ -525,7 +531,17 @@ NetHandler::mainNetEvent(int event, Event *e) close_UnixNetVConnection(vc, trigger_event->ethread); else if (vc->read.enabled && vc->read.triggered) vc->net_read_io(this, trigger_event->ethread); -else if (!vc->read.enabled) { +else if (vc->read.error) { + int err = 0, errlen = sizeof(int); + if (getsockopt(vc->con.fd, SOL_SOCKET, SO_ERROR, , (socklen_t *)) == -1) { +err = errno; + } + if (err != EAGAIN && err != EINTR) { +vc->readSignalError(this, err); --- End diff -- ``` static void read_from_net(NetHandler *nh, UnixNetVConnection *vc, EThread *thread) { ... if (vc->closed) { close_UnixNetVConnection(vc, thread); return; } + // if it is not triggered and got error from polling + if (!s->triggered && s->error) { +int err = 0, errlen = sizeof(int); +if (getsockopt(vc->con.fd, SOL_SOCKET, SO_ERROR, , (socklen_t *)) == -1) { + err = errno; +} +if (err != EAGAIN && err != EINTR) { + read_signal_error(this, vc, err); +} +return; + } // if it is not enabled. if (!s->enabled || s->vio.op != VIO::READ) { read_disable(nh, vc); return; } ... } ``` Issue Time Tracking --- Worklog Id: (was: 28265) Time Spent: 5h 10m (was: 5h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 5h 10m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28264=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28264 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 07/Sep/16 06:10 Start Date: 07/Sep/16 06:10 Worklog Time Spent: 10m Work Description: Github user oknet commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/947#discussion_r77764403 --- Diff: iocore/net/UnixNet.cc --- @@ -525,7 +531,17 @@ NetHandler::mainNetEvent(int event, Event *e) close_UnixNetVConnection(vc, trigger_event->ethread); else if (vc->read.enabled && vc->read.triggered) vc->net_read_io(this, trigger_event->ethread); -else if (!vc->read.enabled) { +else if (vc->read.error) { + int err = 0, errlen = sizeof(int); + if (getsockopt(vc->con.fd, SOL_SOCKET, SO_ERROR, , (socklen_t *)) == -1) { +err = errno; + } + if (err != EAGAIN && err != EINTR) { +vc->readSignalError(this, err); --- End diff -- Sorry, my mistaken here. We should get vio mutex locked first before callback to SM. the new suggest : ``` else if (vc->read.enabled && vc->read.triggered || vc->read.error) ``` move "else if (vc->read.error) { ... }" into "vc->net_read_io()" we can not access any member of NetVC ( e.g. vc->con.fd ) before get vio mutex locked. Issue Time Tracking --- Worklog Id: (was: 28264) Time Spent: 5h (was: 4h 50m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 5h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28220=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28220 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 06/Sep/16 19:26 Start Date: 06/Sep/16 19:26 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/607/ for details. Issue Time Tracking --- Worklog Id: (was: 28220) Time Spent: 4h 50m (was: 4h 40m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 4h 50m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28219=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28219 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 06/Sep/16 19:20 Start Date: 06/Sep/16 19:20 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/711/ for details. Issue Time Tracking --- Worklog Id: (was: 28219) Time Spent: 4h 40m (was: 4.5h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 4h 40m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28216=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28216 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 06/Sep/16 19:15 Start Date: 06/Sep/16 19:15 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/606/ for details. Issue Time Tracking --- Worklog Id: (was: 28216) Time Spent: 4.5h (was: 4h 20m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 4.5h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28213=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28213 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 06/Sep/16 19:13 Start Date: 06/Sep/16 19:13 Worklog Time Spent: 10m Work Description: Github user jacksontj commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/947#discussion_r77699771 --- Diff: iocore/net/UnixNet.cc --- @@ -542,7 +555,14 @@ NetHandler::mainNetEvent(int event, Event *e) close_UnixNetVConnection(vc, trigger_event->ethread); else if (vc->write.enabled && vc->write.triggered) write_to_net(this, vc, trigger_event->ethread); -else if (!vc->write.enabled) { +else if (vc->write.error) { + int err = 0, errlen = sizeof(int); + if (getsockopt(vc->con.fd, SOL_SOCKET, SO_ERROR, , (socklen_t *)) == -1) { +err = errno; + } + if (err != EAGAIN && err != EINTR) +vc->writeSignalError(this, err); +} else if (!vc->write.enabled) { --- End diff -- Done :) Issue Time Tracking --- Worklog Id: (was: 28213) Time Spent: 4h 20m (was: 4h 10m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 4h 20m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28107=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28107 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 05/Sep/16 10:08 Start Date: 05/Sep/16 10:08 Worklog Time Spent: 10m Work Description: Github user oknet commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/947#discussion_r77499140 --- Diff: iocore/net/UnixNet.cc --- @@ -542,7 +555,14 @@ NetHandler::mainNetEvent(int event, Event *e) close_UnixNetVConnection(vc, trigger_event->ethread); else if (vc->write.enabled && vc->write.triggered) write_to_net(this, vc, trigger_event->ethread); -else if (!vc->write.enabled) { +else if (vc->write.error) { + int err = 0, errlen = sizeof(int); + if (getsockopt(vc->con.fd, SOL_SOCKET, SO_ERROR, , (socklen_t *)) == -1) { +err = errno; + } + if (err != EAGAIN && err != EINTR) +vc->writeSignalError(this, err); +} else if (!vc->write.enabled) { --- End diff -- suggest code: ``` else { if (vc->write.error) { ... if (err && err != EAGAIN && err != EINTR) vc->writeSignalError(this, err); else vc->write.error = 0; } if (!vc->write.enabled) { ... } } ``` the same to READ. Issue Time Tracking --- Worklog Id: (was: 28107) Time Spent: 4h 10m (was: 4h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 4h 10m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28056=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28056 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 03/Sep/16 18:05 Start Date: 03/Sep/16 18:05 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/587/ for details. Issue Time Tracking --- Worklog Id: (was: 28056) Time Spent: 4h (was: 3h 50m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 4h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28055=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28055 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 03/Sep/16 18:02 Start Date: 03/Sep/16 18:02 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/691/ for details. Issue Time Tracking --- Worklog Id: (was: 28055) Time Spent: 3h 50m (was: 3h 40m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 3h 50m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28054=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28054 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 03/Sep/16 17:52 Start Date: 03/Sep/16 17:52 Worklog Time Spent: 10m Work Description: Github user jacksontj commented on the issue: https://github.com/apache/trafficserver/pull/947 That all sounds reasonable :) I just pushed a new commit here which does effectively what you are suggesting-- just both on the read and write side (as well as the few other little changes to make it work). I tested it and this covers my use-case (since we are still bubbling the error up when we aren't enabled) and should continue functioning the same for all the rest of the cases (since left them alone). Issue Time Tracking --- Worklog Id: (was: 28054) Time Spent: 3h 40m (was: 3.5h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 3h 40m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=28050=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28050 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 03/Sep/16 06:34 Start Date: 03/Sep/16 06:34 Worklog Time Spent: 10m Work Description: Github user oknet commented on the issue: https://github.com/apache/trafficserver/pull/947 comments for codes: ``` if (get_ev_events(pd, x) & (EVENTIO_READ | EVENTIO_ERROR)) { // ** set read.triggered if a epoll event of net has EVENTIO_READ or EVENTIO_ERROR bit set. vc->read.triggered = 1; // ** and put vc in read_ready_list if (!read_ready_list.in(vc)) { read_ready_list.enqueue(vc); } else if (get_ev_events(pd, x) & EVENTIO_ERROR) { // ** output an error message if a netvc already in ready_list got EVENTIO_ERROR. // check for unhandled epoll events that should be handled Debug("iocore_net_main", "Unhandled epoll event on read: 0x%04x read.enabled=%d closed=%d read.netready_queue=%d", get_ev_events(pd, x), vc->read.enabled, vc->closed, read_ready_list.in(vc)); } } ``` The netvc always put in read_ready_list if it has EVENTIO_READ or EVENTIO_ERROR. ``` #if defined(USE_EDGE_TRIGGER) // UnixNetVConnection * // ** for each netvc in read_ready_list while ((vc = read_ready_list.dequeue())) { if (vc->closed) // ** if the netvc mark closed close_UnixNetVConnection(vc, trigger_event->ethread); else if (vc->read.enabled && vc->read.triggered) //** if the netvc is enabled and triggered vc->net_read_io(this, trigger_event->ethread); else if (!vc->read.enabled) { //** if the netvc is not enabled read_ready_list.remove(vc); #if defined(solaris) if (vc->read.triggered && vc->write.enabled) { vc->ep.modify(-EVENTIO_READ); vc->ep.refresh(EVENTIO_WRITE); vc->writeReschedule(this); } #endif } } ``` for your case, read.enabled is 0 ``` else if (!vc->read.enabled) { // if the netvc is not enabled read_ready_list.remove(vc); ``` The vc is removed from read_ready_list. The below is my suggest: ``` if (get_ev_events(pd, x) & (EVENTIO_READ | EVENTIO_ERROR)) { vc->read.triggered = 1; + if (get_ev_events(pd, x) & EVENTIO_ERROR) { +vc->read.error = 1; + } if (!read_ready_list.in(vc)) { read_ready_list.enqueue(vc); } else if (get_ev_events(pd, x) & EVENTIO_ERROR) { ``` and ``` else if (vc->read.enabled && vc->read.triggered) //** if the netvc is enabled and triggered vc->net_read_io(this, trigger_event->ethread); + else if (vc->read.error) { +int err = 0, errlen = sizeof(int); +if (getsockopt(fd, SOL_SOCKET, SO_ERROR, , ) == -1) { + err = errno; +} +if (err != EAGAIN && err != EINTR) + vc->readSignalError(this, err); + } else if (!vc->read.enabled) { //** if the netvc is not enabled read_ready_list.remove(vc); #if defined(solaris) if (vc->read.triggered && vc->write.enabled) { vc->ep.modify(-EVENTIO_READ); vc->ep.refresh(EVENTIO_WRITE); ``` Issue Time Tracking --- Worklog Id: (was: 28050) Time Spent: 3.5h (was: 3h 20m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 3.5h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > >
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27954=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27954 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 02/Sep/16 17:37 Start Date: 02/Sep/16 17:37 Worklog Time Spent: 10m Work Description: Github user oknet commented on the issue: https://github.com/apache/trafficserver/pull/947 according your description, the HttpTunnel transfers the data from server session to client session, ATS received a RST from client and the connection between ATS and origin server is still alive. In your scenario, server session is the producer of HttpTunnel and client session is a consumer of HttpTunnel and cache session is the 2nd consumer if cache enabled. The HttpTunnel will not break if one consumer failed. The producer will re-enable all consumers if received READ_READY event. The consumer will re-enable producer if received WRITE_READY event. The producer is master and all consumers are slave. let the master trigger slaves and isolate the broken slave. Add a netvc into write_ready queue means there is non-fatal error(ex EAGAIN) at last write() call. It means write is enabled on the netvc. Only the returned errno from read() and write() is trustable. To close a netvc immediately if vc->read.vio._cont and vc->write.vio._cont both are NULL. Otherwise should callback to SM. Issue Time Tracking --- Worklog Id: (was: 27954) Time Spent: 3h 20m (was: 3h 10m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 3h 20m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27927=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27927 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 02/Sep/16 14:53 Start Date: 02/Sep/16 14:53 Worklog Time Spent: 10m Work Description: Github user jacksontj commented on the issue: https://github.com/apache/trafficserver/pull/947 The behavior I see on master (without this patch) is that ATS doesn't close the session when getting the RST. From digging that UnixNetHandler gets an EPOLLERR -- which attempts to add it to the write_ready queue, but since the vc isn't enabled for writing the HTTPTunnel isn't ever called to do the write. So from your last 2 comments it sounds like a more correct approach would be to immediately schedule a read/write to the socket -- to determine if there was in fact an error. It also sounds like you are suggesting that inactivity cop should get these sessions? In my tests I see that these sessions are either killed by the next attempt to write to the closed socket (when the origin sends more bytes later) or when the transaction hits the max inactivity timeout. Neither of these behaviors are what we want-- since I already got an RST from the client. So it seems that we need to somehow force-schedule a read/write in these error conditions-- do you have any pointers on how to do that? Issue Time Tracking --- Worklog Id: (was: 27927) Time Spent: 3h 10m (was: 3h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 3h 10m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27901=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27901 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 02/Sep/16 06:38 Start Date: 02/Sep/16 06:38 Worklog Time Spent: 10m Work Description: Github user oknet commented on the issue: https://github.com/apache/trafficserver/pull/947 The InactivityCop will handle those netvc that read or write disabled. InactivityCop will send TIMEOUT to SM or call close_UnixNetVConnection() to close netvc directly depend on the last call to do_io_read and do_io_write. To disable read and write but only handle Timeout Event: do_io_read(sm, 0, NULL) and do_io_write(sm, 0, NULL) The sm will receive TIMEOUT from InactivityCop and reset timeout or close netvc. To disable read and write and ignore timeout: do_io_read(NULL, 0, NULL) and do_io_write(NULL, 0, NULL) The sm will not receive any Event from the netvc and InactivityCop will close netvc while timeout. Note: The InactivityCop try to send TIMEOUT to read.vio._cont first and then write.vio._cont if read.vio._cont is NULL. Issue Time Tracking --- Worklog Id: (was: 27901) Time Spent: 3h (was: 2h 50m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 3h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27886=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27886 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 02/Sep/16 02:09 Start Date: 02/Sep/16 02:09 Worklog Time Spent: 10m Work Description: Github user oknet commented on the issue: https://github.com/apache/trafficserver/pull/947 EVENTIO_ERROR means EPOLLHUP | EPOLLERR | EPOLLPRI. EPOLLPRI means OOB or TCP URG is set. You will always receive EPOLLPRI with EPOLLIN. To EPOLLPRI, we need handle READ first and ignore EPOLLPRI, this is what NetHandler does. EPOLLHUP & EPOLLRDHUP reference : http://stackoverflow.com/questions/8707458/epoll-and-remote-1-way-shutdown ``` A socket listening for epoll events will typically receive an EPOLLRDHUP (in addition to EPOLLIN) event flag upon the remote peer calling close or shutdown(SHUT_WR). This does not neccessarily mean the socket is dead. Subsequent calls to recv() will return any unread data on the socket and eventually "0" will be returned to indicate EOF. It may even be possible to send data back if the remote peer only did a half-close of its socket. The one notable exception is if the remote peer is using the SO_LINGER option enabled on its socket with a linger value of "0". The result of closing such a socket may result in a TCP RST getting sent instead of a FIN. From what I've read, a connection reset event will generate either a EPOLLHUP or EPOLLERR. (I haven't had time to confirm, but it makes sense). There is some documentation to suggest there are older Linux implementations that don't support EPOLLRDHUP, as such EPOLLHUP gets generated instead. And for what it is worth, in my particular case, I found that it is not too interesting to have code that special cases EPOLLHUP or EPOLLRDHUP events. Instead, just treat these events the same as EPOLLIN/EPOLLOUT and call recv() (or send() as appropriate). But pay close attention to return codes returned back from recv() and send(). ``` EPOLLERR means the possible non-fatal errors on socket fd such as EAGAIN, EINTR, EWOULDBLOCK and fatal errors. When you receive EPLLERR, it means an error of socketfd and also there may be data before this error. Therefore we should call read() and write() to figure out the actual meanning of this error Currently, NetHandler try to perform read() & write() on the socket fd first. We will get non-fatal errors or fatal erros from read() or write(). if it is non-fatal error, just put socket fd into wait list. if it is fatal error, signal SM to close socket fd. e.g. There is a Fatal ERROR if EPIPE is returned from write(). If "0" is returned from read() there is EOF. So the currently implement of NetHandler is enough to handle all of this and doesn't need to change. Issue Time Tracking --- Worklog Id: (was: 27886) Time Spent: 2h 50m (was: 2h 40m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 2h 50m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0]
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27811=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27811 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 01/Sep/16 21:26 Start Date: 01/Sep/16 21:26 Worklog Time Spent: 10m Work Description: Github user jpeach commented on the issue: https://github.com/apache/trafficserver/pull/947 I don't think this is the right approach. First, ``read_signal_error`` and ``write_signal_error`` don't need to be made non-static since you already have ``UnixNetVConnection::readSignalError()``. Second, the ``err`` argument to ``read_signal_error`` is supposed to be an ``errno``, but you are passing and eventio bitmask. That's not really what is supposed to happen here. Third, the logic in ``NetHandler::mainNetEvent`` is now weird. There is a subsequent check for ``get_ev_events(pd, x) & (EVENTIO_READ | EVENTIO_ERROR)``, but the error case would never be true now. Finally, does this change mean that ``VC_EVENT_EOS`` is now delivered as ``VC_EVENT_ERROR``? The ``EVENTIO_ERROR`` bitmask includes the ``HUP`` event, which I suspect means that the socket was closed. I think the expectation is that this would be detected in ``read_from_net``, but now it looks like you would get an error event. Issue Time Tracking --- Worklog Id: (was: 27811) Time Spent: 2.5h (was: 2h 20m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 2.5h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27812=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27812 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 01/Sep/16 21:26 Start Date: 01/Sep/16 21:26 Worklog Time Spent: 10m Work Description: Github user jpeach commented on the issue: https://github.com/apache/trafficserver/pull/947 /cc @oknet Issue Time Tracking --- Worklog Id: (was: 27812) Time Spent: 2h 40m (was: 2.5h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 2h 40m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27730=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27730 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 01/Sep/16 15:17 Start Date: 01/Sep/16 15:17 Worklog Time Spent: 10m Work Description: Github user SolidWallOfCode commented on the issue: https://github.com/apache/trafficserver/pull/947 Seems reasonable. I can't think why the errors shouldn't bubble up. We may need to be a bit careful on handling them though. Issue Time Tracking --- Worklog Id: (was: 27730) Time Spent: 2h 20m (was: 2h 10m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 2h 20m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27696=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27696 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 01/Sep/16 05:24 Start Date: 01/Sep/16 05:24 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/556/ for details. Issue Time Tracking --- Worklog Id: (was: 27696) Time Spent: 2h 10m (was: 2h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 2h 10m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27695=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27695 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 01/Sep/16 05:23 Start Date: 01/Sep/16 05:23 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *failed*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/661/ for details. Issue Time Tracking --- Worklog Id: (was: 27695) Time Spent: 2h (was: 1h 50m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 2h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27678=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27678 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 01/Sep/16 01:59 Start Date: 01/Sep/16 01:59 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/554/ for details. Issue Time Tracking --- Worklog Id: (was: 27678) Time Spent: 1h 50m (was: 1h 40m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 1h 50m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27677=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27677 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 01/Sep/16 01:55 Start Date: 01/Sep/16 01:55 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *failed*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/659/ for details. Issue Time Tracking --- Worklog Id: (was: 27677) Time Spent: 1h 40m (was: 1.5h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 1h 40m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27648=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27648 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 31/Aug/16 22:20 Start Date: 31/Aug/16 22:20 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *failed*! See https://ci.trafficserver.apache.org/job/Github-Linux/551/ for details. Issue Time Tracking --- Worklog Id: (was: 27648) Time Spent: 1.5h (was: 1h 20m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 1.5h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27647=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27647 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 31/Aug/16 22:19 Start Date: 31/Aug/16 22:19 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *failed*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/656/ for details. Issue Time Tracking --- Worklog Id: (was: 27647) Time Spent: 1h 20m (was: 1h 10m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 1h 20m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27631=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27631 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 31/Aug/16 20:20 Start Date: 31/Aug/16 20:20 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *failed*! See https://ci.trafficserver.apache.org/job/Github-Linux/547/ for details. Issue Time Tracking --- Worklog Id: (was: 27631) Time Spent: 1h 10m (was: 1h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 1h 10m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27630=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27630 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 31/Aug/16 20:19 Start Date: 31/Aug/16 20:19 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *failed*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/652/ for details. Issue Time Tracking --- Worklog Id: (was: 27630) Time Spent: 1h (was: 50m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 1h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27627=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27627 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 31/Aug/16 20:13 Start Date: 31/Aug/16 20:13 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *failed*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/651/ for details. Issue Time Tracking --- Worklog Id: (was: 27627) Time Spent: 40m (was: 0.5h) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 40m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27628=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27628 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 31/Aug/16 20:13 Start Date: 31/Aug/16 20:13 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *failed*! See https://ci.trafficserver.apache.org/job/Github-Linux/546/ for details. Issue Time Tracking --- Worklog Id: (was: 27628) Time Spent: 50m (was: 40m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 50m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27626=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27626 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 31/Aug/16 20:09 Start Date: 31/Aug/16 20:09 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 FreeBSD build *failed*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/650/ for details. Issue Time Tracking --- Worklog Id: (was: 27626) Time Spent: 0.5h (was: 20m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 0.5h > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27625=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27625 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 31/Aug/16 20:08 Start Date: 31/Aug/16 20:08 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/947 Linux build *failed*! See https://ci.trafficserver.apache.org/job/Github-Linux/545/ for details. Issue Time Tracking --- Worklog Id: (was: 27625) Time Spent: 20m (was: 10m) > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 20m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4796) ATS not closing origin connections on first RST from client
[ https://issues.apache.org/jira/browse/TS-4796?focusedWorklogId=27624=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27624 ] ASF GitHub Bot logged work on TS-4796: -- Author: ASF GitHub Bot Created on: 31/Aug/16 20:05 Start Date: 31/Aug/16 20:05 Worklog Time Spent: 10m Work Description: GitHub user jacksontj opened a pull request: https://github.com/apache/trafficserver/pull/947 TS-4796 Change UnixNetHandler to always bubble up epoll errors to the VConnection Before if the vcon wasn't read or write enabled errors would be swallowed. This leads to a variety of issues where the socket errors aren't dealt with immediately. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jacksontj/trafficserver TS-4796 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/trafficserver/pull/947.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 #947 commit 5b032bae9fe1d30bffa79a5ce8da12dabf7468be Author: Thomas JacksonDate: 2016-08-31T20:02:53Z TS-4796 Change UnixNetHandler to always bubble up epoll errors to the VConnection Before if the vcon wasn't read or write enabled errors would be swallowed. This leads to a variety of issues where the socket errors aren't dealt with immediately. Issue Time Tracking --- Worklog Id: (was: 27624) Time Spent: 10m Remaining Estimate: 0h > ATS not closing origin connections on first RST from client > --- > > Key: TS-4796 > URL: https://issues.apache.org/jira/browse/TS-4796 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Thomas Jackson >Assignee: Thomas Jackson > Time Spent: 10m > Remaining Estimate: 0h > > *TLDR; similar to TS-4720 -- slower to close than it should, instead of never > closing* > As a continuation of TS-4720, while testing that the session is closed when > we expect-- I found that it isn't. > Although we are now closing the sessions, we aren't doing it as quickly as we > should. In this client abort case we expect the client to abort, and ATS > should initially continue to send bytes to the client-- as we are in the > half-open state. After the first set of bytes are sent to the client-- the > client will send an RST-- which should signal ATS to stop sending the request > (and tear down the origin connection etc.). > I'm able to reproduce this locally, and the debug output (with some > additional comments) looks like below: > {code} > < FIN FROM CLIENT > > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (main_handler)> (http) [0] [HttpSM::main_handler, VC_EVENT_EOS] > [Aug 29 18:25:07.491] Server {0x7effa538a800} DEBUG: (state_watch_for_client_abort)> (http) [0] > [::state_watch_for_client_abort, VC_EVENT_EOS] > < RST FROM CLIENT > > Got an HttpTunnel event 100 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_tunnel) [0] producer_handler [http server > VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler_chunked)> (http_tunnel) [0] producer_handler_chunked [http > server VC_EVENT_READ_READY] > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_size)> (http_chunk) read chunk size of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (read_chunk)> (http_chunk) completed read of chunk of 15 bytes > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (producer_handler)> (http_redirect) [HttpTunnel::producer_handler] > enable_redirection: [1 0 0] event: 100 > Got an HttpTunnel event 101 > [Aug 29 18:25:13.062] Server {0x7effa538a800} DEBUG: (consumer_handler)> (http_tunnel) [0] consumer_handler [user agent > VC_EVENT_WRITE_READY] > write ready consumer_handler > {code} > In this situation the connection doesn't close here at the RST-- but rather > on the next set of bytes from the origin to send-- which end up tripping a > VC_EVENT_ERROR-- and tearing down the connection. > When the client sends the first RST epoll returns a WRITE_READY event -- > which the HTTPTunnel consumer ignores completely. It seems then that when we > recieve the WRITE_READY event we need to determine if we are already in the > writing state-- and if so, then we should stop the transaction (since we are > already edge-triggered). -- This message was sent by Atlassian JIRA (v6.3.4#6332)