| 68 | } |
| 69 | |
| 70 | bool |
| 71 | Http2CommonSession::common_free(ProxySession *ssn) |
| 72 | { |
| 73 | if (this->_reenable_event) { |
| 74 | this->_reenable_event->cancel(); |
| 75 | this->_reenable_event = nullptr; |
| 76 | } |
| 77 | |
| 78 | // Make sure the we are at the bottom of the stack |
| 79 | if (this->connection_state.is_recursing() || this->recursion != 0) { |
| 80 | // Note that we are ready to be cleaned up |
| 81 | // One of the event handlers will catch it |
| 82 | this->kill_me = true; |
| 83 | return false; |
| 84 | } |
| 85 | |
| 86 | REMEMBER(NO_EVENT, this->recursion) |
| 87 | Http2SsnDebug("session free"); |
| 88 | |
| 89 | // Don't free active ProxySession |
| 90 | ink_release_assert(ssn->is_active() == false); |
| 91 | |
| 92 | this->_milestones.mark(Http2SsnMilestone::CLOSE); |
| 93 | ink_hrtime total_time = this->_milestones.elapsed(Http2SsnMilestone::OPEN, Http2SsnMilestone::CLOSE); |
| 94 | |
| 95 | // Slow Log |
| 96 | if (Http2::con_slow_log_threshold != 0 && ink_hrtime_from_msec(Http2::con_slow_log_threshold) < total_time) { |
| 97 | Error("[%" PRIu64 "] Slow H2 Connection: open: %" PRIu64 " close: %.3f", ssn->connection_id(), |
| 98 | ink_hrtime_to_msec(this->_milestones[Http2SsnMilestone::OPEN]), |
| 99 | this->_milestones.difference_sec(Http2SsnMilestone::OPEN, Http2SsnMilestone::CLOSE)); |
| 100 | } |
| 101 | |
| 102 | // Update stats on how we died. May want to eliminate this. Was useful for |
| 103 | // tracking down which cases we were having problems cleaning up. But for general |
| 104 | // use probably not worth the effort |
| 105 | if (cause_of_death != Http2SessionCod::NOT_PROVIDED) { |
| 106 | switch (cause_of_death) { |
| 107 | case Http2SessionCod::HIGH_ERROR_RATE: |
| 108 | Metrics::Counter::increment(http2_rsb.session_die_high_error_rate); |
| 109 | break; |
| 110 | case Http2SessionCod::NOT_PROVIDED: |
| 111 | // Can't happen but this case is here to not have default case. |
| 112 | Metrics::Counter::increment(http2_rsb.session_die_other); |
| 113 | break; |
| 114 | } |
| 115 | } else { |
| 116 | switch (dying_event) { |
| 117 | case VC_EVENT_NONE: |
| 118 | Metrics::Counter::increment(http2_rsb.session_die_default); |
| 119 | break; |
| 120 | case VC_EVENT_ACTIVE_TIMEOUT: |
| 121 | Metrics::Counter::increment(http2_rsb.session_die_active); |
| 122 | break; |
| 123 | case VC_EVENT_INACTIVITY_TIMEOUT: |
| 124 | Metrics::Counter::increment(http2_rsb.session_die_inactive); |
| 125 | break; |
| 126 | case VC_EVENT_ERROR: |
| 127 | Metrics::Counter::increment(http2_rsb.session_die_error); |
nothing calls this directly
no test coverage detected