MCPcopy Create free account
hub / github.com/apache/trafficserver / common_free

Method common_free

src/proxy/http2/Http2CommonSession.cc:70–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70bool
71Http2CommonSession::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);

Callers

nothing calls this directly

Calls 13

ink_hrtime_from_msecFunction · 0.85
ink_hrtime_to_msecFunction · 0.85
incrementFunction · 0.85
free_MIOBufferFunction · 0.85
difference_secMethod · 0.80
ErrorClass · 0.50
cancelMethod · 0.45
is_recursingMethod · 0.45
is_activeMethod · 0.45
markMethod · 0.45
elapsedMethod · 0.45
connection_idMethod · 0.45

Tested by

no test coverage detected