chenBright commented on code in PR #1814:
URL: https://github.com/apache/incubator-brpc/pull/1814#discussion_r913345767
##########
src/brpc/socket_map.cpp:
##########
@@ -301,6 +301,7 @@ void SocketMap::RemoveInternal(const SocketMapKey& key,
_this_map_bvar = new bvar::PassiveStatus<std::string>(
butil::StringPiece(namebuf, len), PrintSocketMap, this);
}
+ s->DisableHealthCheck(); // disable health check
Review Comment:
函数名改成ReleaseClientSocketMapRef应该比较直观,在这个函数里将引用计数减一并置标志位。HealthCheckTask预期就是依赖SocketMap的引用,当HealthCheckTask里Wait到引用计数为2后,判断一下标志位。
无论是DisableHealthCheck还是ReleaseClientSocketMapRef,这个接口都是不通用的,得加注释说明只能SocketMap调用。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]