You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2018/05/09 10:52:43 UTC
[trafficserver] branch 7.1.x updated: Expanding the cases where the
server_entry gets cleared on error.
This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/7.1.x by this push:
new f1e3e4e Expanding the cases where the server_entry gets cleared on error.
f1e3e4e is described below
commit f1e3e4e0afee68a33848864c4a54038efddfaab4
Author: Susan Hinrichs <sh...@apache.org>
AuthorDate: Tue Jan 23 08:57:54 2018 -0600
Expanding the cases where the server_entry gets cleared on error.
(cherry picked from commit 784ba4383db72892ba794a7b83904af370b6f35a)
Conflicts:
proxy/http/HttpTransact.cc
---
proxy/http/HttpSM.cc | 18 +++++++++++-------
proxy/http/HttpTransact.cc | 5 ++---
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index fb7cf87..f734ad9 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -5487,14 +5487,16 @@ HttpSM::handle_server_setup_error(int event, void *data)
ua_producer->alive = false;
ua_producer->handler_state = HTTP_SM_POST_SERVER_FAIL;
tunnel.handleEvent(VC_EVENT_ERROR, c->write_vio);
+ return;
}
} else {
// c could be null here as well
if (c != nullptr) {
tunnel.handleEvent(event, c->write_vio);
+ return;
}
}
- return;
+ // If there is no consumer, let the event pass through to shutdown
} else {
if (post_transform_info.vc) {
HttpTunnelConsumer *c = tunnel.get_consumer(post_transform_info.vc);
@@ -5531,15 +5533,17 @@ HttpSM::handle_server_setup_error(int event, void *data)
// if (vio->op == VIO::WRITE && vio->ndone == 0) {
if (server_entry->write_vio && server_entry->write_vio->nbytes > 0 && server_entry->write_vio->ndone == 0) {
t_state.current.state = HttpTransact::CONNECTION_ERROR;
- if (server_entry) {
- ink_assert(server_entry->vc_type == HTTP_SERVER_VC);
- vc_table.cleanup_entry(server_entry);
- server_entry = nullptr;
- server_session = nullptr;
- }
} else {
t_state.current.state = HttpTransact::INACTIVE_TIMEOUT;
}
+ // Clean up the vc_table entry so any events in play to the timed out server vio
+ // don't get handled. The connection isn't there.
+ if (server_entry) {
+ ink_assert(server_entry->vc_type == HTTP_SERVER_VC);
+ vc_table.cleanup_entry(server_entry);
+ server_entry = nullptr;
+ server_session = nullptr;
+ }
break;
default:
ink_release_assert(0);
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 2178b33..c4cd9bf 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -6587,10 +6587,9 @@ HttpTransact::is_request_retryable(State *s)
{
// If safe requests are retryable, it should be safe to retry safe requests irrespective of bytes sent or connection state
// according to RFC the following methods are safe (https://tools.ietf.org/html/rfc7231#section-4.2.1)
- // If there was no error establishing the connection (and we sent bytes)-- we cannot retry
+ // Otherwise, if there was no error establishing the connection (and we sent bytes)-- we cannot retry
if (!(s->txn_conf->safe_requests_retryable && HttpTransactHeaders::is_method_safe(s->method)) &&
- (s->current.state != CONNECTION_ERROR && s->state_machine->server_request_hdr_bytes > 0 &&
- s->state_machine->get_server_session()->get_netvc()->outstanding() != s->state_machine->server_request_hdr_bytes)) {
+ s->current.state != CONNECTION_ERROR && s->state_machine->server_request_hdr_bytes > 0) {
return false;
}
--
To stop receiving notification emails like this one, please contact
zwoop@apache.org.