Skip to content

Commit

Permalink
[coro_rpc] fix ELOG data race in coro_rpc::coro_rpc_server::stop() (#890
Browse files Browse the repository at this point in the history
)

[coro_rpc] fix data race in coro_rpc
  • Loading branch information
poor-circle authored Jan 27, 2025
1 parent 46abbb3 commit f4744e8
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 f4744e8

Please sign in to comment.