darion-yaphet commented on code in PR #3590:
URL: https://github.com/apache/brpc/pull/3590#discussion_r4303575266
##########
src/brpc/server.cpp:
##########
@@ -451,6 +451,8 @@ Server::Server(ProfilerLinker)
Server::~Server() {
Stop(0);
Join();
+ // Stop()/Join() are no-ops when a Start() failed before RUNNING.
+ DestroyPreStartAllocations();
Review Comment:
> I think we should refactor `Server::Join()` to handle pre-start cleanup on
its early-return path as well. Both that path and the normal post-join path
could use a shared cleanup helper, while preserving the existing shutdown
ordering.
I'd prefer to keep the current cleanup boundaries. Both paths already handle
cleanup, so adding it to Join()'s early-return path would change its behavior
without a clear correctness benefit. Sharing a helper should address the
duplication sufficiently.
--
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]