Skip to content

Commit 313931a

Browse files
committed
Don't wait Yt poller thread shutdown under lock
commit_hash:1ddf88b71f3418bee4e3621d13b822ef59dc8e9d
1 parent 731eb6b commit 313931a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

yt/cpp/mapreduce/client/client.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,10 +1516,14 @@ TYtPoller& TClient::GetYtPoller()
15161516

15171517
void TClient::Shutdown()
15181518
{
1519-
auto g = Guard(Lock_);
1520-
1521-
if (!Shutdown_.exchange(true) && YtPoller_) {
1522-
YtPoller_->Stop();
1519+
std::unique_ptr<TYtPoller> poller;
1520+
with_lock(Lock_) {
1521+
if (!Shutdown_.exchange(true) && YtPoller_) {
1522+
poller = std::move(YtPoller_);
1523+
}
1524+
}
1525+
if (poller) {
1526+
poller->Stop();
15231527
}
15241528
}
15251529

0 commit comments

Comments
 (0)