-
Notifications
You must be signed in to change notification settings - Fork 844
Avoid stale client_vc #6732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid stale client_vc #6732
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,9 +111,6 @@ Http1ClientSession::free() | |
| conn_decrease = false; | ||
| } | ||
|
|
||
| // Clean up the write VIO in case of inactivity timeout | ||
| this->do_io_write(nullptr, 0, nullptr); | ||
|
|
||
| // Free the transaction resources | ||
| this->trans.super_type::destroy(); | ||
|
|
||
|
|
@@ -228,12 +225,13 @@ Http1ClientSession::do_io_close(int alerrno) | |
| slave_ka_vio = nullptr; | ||
| } | ||
| // Completed the last transaction. Just shutdown already | ||
| if (transact_count == released_transactions) { | ||
| // Or the do_io_close is due to a network error | ||
| if (transact_count == released_transactions || alerrno == HTTP_ERRNO) { | ||
| half_close = false; | ||
| } | ||
|
|
||
| // Clean up the write VIO in case of inactivity timeout | ||
| this->do_io_write(nullptr, 0, nullptr); | ||
| this->do_io_write(this, 0, nullptr); | ||
|
|
||
| if (half_close && this->trans.get_sm()) { | ||
| read_state = HCS_HALF_CLOSED; | ||
|
|
@@ -293,11 +291,7 @@ Http1ClientSession::state_wait_for_close(int event, void *data) | |
| case VC_EVENT_ACTIVE_TIMEOUT: | ||
| case VC_EVENT_INACTIVITY_TIMEOUT: | ||
| half_close = false; | ||
| this->do_io_close(); | ||
| if (_vc != nullptr) { | ||
| _vc->do_io_close(); | ||
| _vc = nullptr; | ||
| } | ||
| this->do_io_close(EHTTP_ERROR); | ||
| break; | ||
| case VC_EVENT_READ_READY: | ||
| // Drain any data read | ||
|
|
@@ -373,11 +367,7 @@ Http1ClientSession::state_keep_alive(int event, void *data) | |
| break; | ||
|
|
||
| case VC_EVENT_EOS: | ||
| this->do_io_close(); | ||
| if (_vc != nullptr) { | ||
| _vc->do_io_close(); | ||
| _vc = nullptr; | ||
| } | ||
| this->do_io_close(EHTTP_ERROR); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explained in person - this is to force full close, never half close. Might be better to not pass an error and explicitly set |
||
| break; | ||
|
|
||
| case VC_EVENT_READ_COMPLETE: | ||
|
|
@@ -389,7 +379,7 @@ Http1ClientSession::state_keep_alive(int event, void *data) | |
| case VC_EVENT_ACTIVE_TIMEOUT: | ||
| case VC_EVENT_INACTIVITY_TIMEOUT: | ||
| // Keep-alive timed out | ||
| this->do_io_close(); | ||
| this->do_io_close(EHTTP_ERROR); | ||
| break; | ||
| } | ||
|
|
||
|
|
@@ -403,7 +393,7 @@ Http1ClientSession::release(ProxyTransaction *trans) | |
| ink_assert(read_state == HCS_ACTIVE_READER || read_state == HCS_INIT); | ||
|
|
||
| // Clean up the write VIO in case of inactivity timeout | ||
| this->do_io_write(nullptr, 0, nullptr); | ||
| this->do_io_write(this, 0, nullptr); | ||
|
|
||
| // Check to see there is remaining data in the | ||
| // buffer. If there is, spin up a new state | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems redundant -
do_io_closewill set it.