Skip to content

Commit

Permalink
Remove incorrect assert in inactivity timeout handling (apache#7012)
Browse files Browse the repository at this point in the history
Also fix duplicate decrement of current client connection metric
  • Loading branch information
sudheerv authored and whutwhu committed Nov 1, 2020
1 parent c8481da commit ad9001d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions proxy/http/Http1ClientSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,13 @@ Http1ClientSession::release_transaction()
released_transactions++;
if (transact_count == released_transactions) {
// Make sure we previously called release() or do_io_close() on the session
ink_release_assert(read_state != HCS_ACTIVE_READER && read_state != HCS_INIT);
destroy();
ink_release_assert(read_state != HCS_INIT);
if (read_state == HCS_ACTIVE_READER) {
// (in)active timeout
do_io_close(HTTP_ERRNO);
} else {
destroy();
}
}
}

Expand Down Expand Up @@ -254,10 +259,13 @@ Http1ClientSession::do_io_close(int alerrno)
// READ_READY event.
_reader->consume(_reader->read_avail());
} else {
read_state = HCS_CLOSED;
HttpSsnDebug("[%" PRId64 "] session closed", con_id);
HTTP_SUM_DYN_STAT(http_transactions_per_client_con, transact_count);
HTTP_DECREMENT_DYN_STAT(http_current_client_connections_stat);
if (read_state != HCS_ACTIVE_READER) {
// donot double decrement
HTTP_DECREMENT_DYN_STAT(http_current_client_connections_stat);
}
read_state = HCS_CLOSED;
conn_decrease = false;
// Can go ahead and close the netvc now, but keeping around the session object
// until all the transactions are closed
Expand Down

0 comments on commit ad9001d

Please sign in to comment.