| 204 | } |
| 205 | |
| 206 | void |
| 207 | Http1ServerSession ::release_transaction() |
| 208 | { |
| 209 | // Must adjust the release count before attempting to hand the session |
| 210 | // back to the session manager to avoid race conditions in the global |
| 211 | // pool case |
| 212 | released_transactions++; |
| 213 | |
| 214 | // Private sessions are never released back to the shared pool |
| 215 | if (this->is_private() || sharing_match == 0) { |
| 216 | if (this->is_private()) { |
| 217 | Metrics::Counter::increment(http_rsb.origin_close_private); |
| 218 | } |
| 219 | this->do_io_close(); |
| 220 | } else if (state == SSN_TO_RELEASE) { |
| 221 | _vc->control_flags.set_flags(0); |
| 222 | |
| 223 | // do not change the read/write cont and mutex yet |
| 224 | // release_session() will either swap them with the |
| 225 | // pool continuation with a valid read buffer or if |
| 226 | // it fails, do_io_close() will clear the cont anyway |
| 227 | |
| 228 | HSMresult_t r = httpSessionManager.release_session(this); |
| 229 | |
| 230 | if (r == HSM_RETRY) { |
| 231 | // Session could not be put in the session manager |
| 232 | // due to lock contention |
| 233 | // FIX: should retry instead of closing |
| 234 | do_io_close(HTTP_ERRNO); |
| 235 | Metrics::Counter::increment(http_rsb.origin_shutdown_pool_lock_contention); |
| 236 | } else { |
| 237 | // The session was successfully put into the session |
| 238 | // manager and it will manage it |
| 239 | // (Note: should never get HSM_NOT_FOUND here) |
| 240 | ink_assert(r == HSM_DONE); |
| 241 | // If the session got picked up immediately by another thread the transact_count could be greater |
| 242 | ink_release_assert(transact_count >= released_transactions); |
| 243 | } |
| 244 | } else { // Not to be released |
| 245 | if (transact_count == released_transactions) { |
| 246 | // Make sure we previously called release() or do_io_close() on the session |
| 247 | ink_release_assert(state != INIT); |
| 248 | do_io_close(HTTP_ERRNO); |
| 249 | } else { |
| 250 | ink_release_assert(transact_count == released_transactions); |
| 251 | } |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | ProxyTransaction * |
| 256 | Http1ServerSession::new_transaction() |
nothing calls this directly
no test coverage detected