Skip to content

Commit

Permalink
[coro_rpc] fix data race in coro_rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
poor-circle committed Jan 26, 2025
1 parent 9d4dfb5 commit d7b0305
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/ylt/coro_rpc/impl/coro_rpc_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,13 @@ class coro_rpc_server_base {
return;
}

ELOG_INFO << "begin to stop coro_rpc_server, conn size " << conns_.size();
ELOG_INFO << "begin to stop coro_rpc_server";

if (flag_ == stat::started) {
close_acceptor();
{
std::unique_lock lock(conns_mtx_);
ELOG_INFO << "total connection count: " << conns_.size();
for (auto &conn : conns_) {
if (!conn.second->has_closed()) {
conn.second->async_close();
Expand Down

0 comments on commit d7b0305

Please sign in to comment.