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

Method release_session

src/proxy/http/HttpSessionManager.cc:520–549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518}
519
520HSMresult_t
521HttpSessionManager::release_session(PoolableSession *to_release)
522{
523 EThread *ethread = this_ethread();
524 ServerSessionPool *pool =
525 TS_SERVER_SESSION_SHARING_POOL_THREAD == to_release->sharing_pool ? ethread->server_session_pool : m_g_pool;
526 bool released_p = true;
527
528 // The per thread lock looks like it should not be needed but if it's not locked the close checking I/O op will crash.
529
530 {
531 MutexLock mlock;
532 MutexTryLock tlock;
533 bool const locked = lockSessionPool(pool->mutex, ethread, this->get_pool_type(), &mlock, &tlock);
534
535 if (locked) {
536 pool->releaseSession(to_release);
537 } else if (this->get_pool_type() == TS_SERVER_SESSION_SHARING_POOL_HYBRID) {
538 // Try again with the thread pool
539 to_release->sharing_pool = TS_SERVER_SESSION_SHARING_POOL_THREAD;
540 return release_session(to_release);
541 } else {
542 Dbg(dbg_ctl_http_ss, "[%" PRId64 "] [release session] could not release session due to lock contention",
543 to_release->connection_id());
544 released_p = false;
545 }
546 }
547
548 return released_p ? HSM_DONE : HSM_RETRY;
549}
550
551void
552ServerSessionPool::removeSession(PoolableSession *to_remove)

Callers 1

release_transactionMethod · 0.80

Calls 5

get_pool_typeMethod · 0.95
this_ethreadFunction · 0.85
lockSessionPoolFunction · 0.85
releaseSessionMethod · 0.80
connection_idMethod · 0.45

Tested by

no test coverage detected