MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CloseSession

Method CloseSession

tensorflow/core/distributed_runtime/master.cc:562–589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560}
561
562void Master::CloseSession(const CloseSessionRequest* req,
563 CloseSessionResponse* resp, MyClosure done) {
564 MasterSession* session = nullptr;
565 {
566 mu_.lock();
567 auto iter = sessions_.find(req->session_handle());
568 if (iter == sessions_.end()) {
569 mu_.unlock();
570 done(errors::Aborted(
571 "Session ", req->session_handle(),
572 " is not found. Possibly, this master has restarted."));
573 return;
574 }
575 // NOTE(mrry): One reference to the session is transferred from
576 // `sessions_[req->session_handle()]` to `session`.
577 session = iter->second;
578 sessions_.erase(iter);
579 mu_.unlock();
580 }
581
582 // Session Close() blocks on thread shutdown. Therefore, we need to
583 // delete it in non-critical thread.
584 SchedClosure([session, done]() {
585 Status s = session->Close();
586 session->Unref();
587 done(s);
588 });
589}
590
591void Master::ListDevices(const ListDevicesRequest* req,
592 ListDevicesResponse* resp, MyClosure done) {

Callers

nothing calls this directly

Calls 9

SchedClosureFunction · 0.85
session_handleMethod · 0.80
lockMethod · 0.45
findMethod · 0.45
endMethod · 0.45
unlockMethod · 0.45
eraseMethod · 0.45
CloseMethod · 0.45
UnrefMethod · 0.45

Tested by

no test coverage detected