Repository navigation
Mark H2 connection inactive only if it is NOT shutting down - #4936
Conversation
Prior this change, HTTP/2 connection is marked as inactive regardless it is shutting down or not.
f898e9f to
37d7749
Compare
| UnixNetVConnection *vc = static_cast<UnixNetVConnection *>(ua_session->get_netvc()); | ||
| if (vc && vc->active_timeout_in == 0) { | ||
| // With heavy traffic, ua_session could be destroyed. Do not touch ua_session after this. | ||
| vc->add_to_keep_alive_queue(); |
There was a problem hiding this comment.
Looks good, however, will Http2ClientSesion::destroy() be called somewhere in vc->add_to_keep_alive_queue() when it frees a session?
I'm not sure if it can be a problem, but if the destroy() wasn't called, it means SSN_CLOSE event wouldn't be fired on the session.
There was a problem hiding this comment.
When vc->add_to_keep_alive_queue() close connection, VC_EVENT_INACTIVITY_TIMEOUT (105) comes to Http2ClientSession::main_event_handler(). It looks like it calls Http2ClientSession::destroy() eventually.
Below is backtrace from VC_EVENT_INACTIVITY_TIMEOUT (105) event on Http2ClientSession::main_event_handler() to Http2ClientSession::destroy().
(lldb) bt
* thread #2, name = '[ET_NET 4]', stop reason = step in
* frame #0: 0x00000001001b81d0 traffic_server`Http2ClientSession::destroy(this=0x00000000077ecb00) at Http2ClientSession.cc:66
frame #1: 0x00000001001c16ac traffic_server`Http2ConnectionState::release_stream(this=0x00000000077ece10, stream=0x0000000000000000) at Http2ConnectionState.cc:1254
frame #2: 0x00000001001bf7a8 traffic_server`Http2ConnectionState::main_event_handler(this=0x00000000077ece10, event=2252, edata=0x00000000077ecb00) at Http2ConnectionState.cc:910
frame #3: 0x0000000100017bd1 traffic_server`Continuation::handleEvent(this=0x00000000077ece10, event=2252, data=0x00000000077ecb00) at I_Continuation.h:190
frame #4: 0x00000001001b997c traffic_server`send_connection_event(cont=0x00000000077ece10, event=2252, edata=0x00000000077ecb00) at Http2ClientSession.cc:58
frame #5: 0x00000001001ba3f4 traffic_server`Http2ClientSession::do_io_close(this=0x00000000077ecb00, alerrno=-1) at Http2ClientSession.cc:259
frame #6: 0x00000001001b8f47 traffic_server`Http2ClientSession::main_event_handler(this=0x00000000077ecb00, event=105, edata=0x0000000000fe4d88) at Http2ClientSession.cc:333
shinrich
left a comment
There was a problem hiding this comment.
Looks good to me too. Basically you are moving the active to inactive logic later to only apply to sessions that aren't in the process of shutting down. That should simplify the shutdown sequence where you really just need to mark the session as going away not bothering with putting into the keep alive queue.
|
Please make a PR for 7.1.x please, looks good so far on 8. |
|
Cherry-picked to 8.0.x |
Prior this change, HTTP/2 connection is marked as inactive regardless it is shutting down or not. I think we don't need to add it to keep-alive queue, if it is shutting down. Fix apache#4504 This is a cherry-pick of apache#4936
Prior this change, HTTP/2 connection is marked as inactive regardless it is shutting down or not.
I think we don't need to add it to keep-alive queue, if it is shutting down.
Fix #4504