[Cleanup] Remove unused method RendezvousMgrInterface::CleanupAll()
.
PiperOrigin-RevId: 306271233 Change-Id: I2cc278deab6bdb9f70d5bb9a7e8678d2969220bd
This commit is contained in:
parent
c93a91e0e0
commit
709f61ee06
@ -115,20 +115,6 @@ void BaseRendezvousMgr::Cleanup(int64 step_id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseRendezvousMgr::CleanupAll() {
|
|
||||||
std::vector<Rendezvous*> rendezs;
|
|
||||||
{
|
|
||||||
mutex_lock l(mu_);
|
|
||||||
for (const auto& entry : table_) {
|
|
||||||
rendezs.push_back(entry.second);
|
|
||||||
}
|
|
||||||
table_.clear();
|
|
||||||
}
|
|
||||||
for (auto rendez : rendezs) {
|
|
||||||
StartAbortRendevous(rendez, errors::Aborted("Shutdown"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseRemoteRendezvous::BaseRemoteRendezvous(const WorkerEnv* env, int64 step_id)
|
BaseRemoteRendezvous::BaseRemoteRendezvous(const WorkerEnv* env, int64 step_id)
|
||||||
: env_(env),
|
: env_(env),
|
||||||
step_id_(step_id),
|
step_id_(step_id),
|
||||||
|
@ -88,9 +88,6 @@ class BaseRendezvousMgr : public RendezvousMgrInterface {
|
|||||||
// periodically calls CleanupAll().
|
// periodically calls CleanupAll().
|
||||||
void Cleanup(int64 step_id) override;
|
void Cleanup(int64 step_id) override;
|
||||||
|
|
||||||
// Removed all rendezvous.
|
|
||||||
void CleanupAll() override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual BaseRemoteRendezvous* Create(int64 step_id,
|
virtual BaseRemoteRendezvous* Create(int64 step_id,
|
||||||
const WorkerEnv* worker_env) = 0;
|
const WorkerEnv* worker_env) = 0;
|
||||||
|
@ -93,9 +93,6 @@ class RendezvousMgrInterface {
|
|||||||
// TODO(zhifengc): Have a background thread in worker that
|
// TODO(zhifengc): Have a background thread in worker that
|
||||||
// periodically calls CleanupAll().
|
// periodically calls CleanupAll().
|
||||||
virtual void Cleanup(int64 step_id) = 0;
|
virtual void Cleanup(int64 step_id) = 0;
|
||||||
|
|
||||||
// Removes all rendezvous.
|
|
||||||
virtual void CleanupAll() = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace tensorflow
|
} // end namespace tensorflow
|
||||||
|
@ -193,24 +193,6 @@ TEST_F(RpcRendezvousMgrTest, CancelAfterReceived) {
|
|||||||
delete cm;
|
delete cm;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(RpcRendezvousMgrTest, CleanupAll) {
|
|
||||||
const Rendezvous::ParsedKey key = MakeKey(Rendezvous::CreateKey(
|
|
||||||
"/job:mnist/replica:1/task:2/cpu:0", 7890,
|
|
||||||
"/job:mnist/replica:1/task:2/cpu:1", "foo", FrameAndIter(0, 0)));
|
|
||||||
{
|
|
||||||
const int64 step_id = 123;
|
|
||||||
RemoteRendezvous* rendez = rmgr_.Find(step_id);
|
|
||||||
TF_ASSERT_OK(rendez->Initialize(&worker_session_));
|
|
||||||
core::ScopedUnref unref(rendez);
|
|
||||||
Rendezvous::Args args;
|
|
||||||
TF_ASSERT_OK(rendez->Send(key, args, V("peach"), false));
|
|
||||||
rmgr_.CleanupAll();
|
|
||||||
Tensor val(DT_STRING);
|
|
||||||
bool val_dead = false;
|
|
||||||
EXPECT_TRUE(errors::IsAborted(rendez->Recv(key, args, &val, &val_dead)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class DummyDeviceContext : public DeviceContext {
|
class DummyDeviceContext : public DeviceContext {
|
||||||
public:
|
public:
|
||||||
explicit DummyDeviceContext(int stream_id) : stream_id_(stream_id) {}
|
explicit DummyDeviceContext(int stream_id) : stream_id_(stream_id) {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user