darion-yaphet commented on PR #3433:
URL: https://github.com/apache/brpc/pull/3433#issuecomment-5318096489

   > Instead of managing the SocketMap key lifecycle for re-init, I'd suggest 
simply rejecting re-initialization once Init() has succeeded. A Channel that's 
initialized exactly once inserts exactly one socket entry and never mutates 
_options afterward, so the signature recomputed in ~Channel() always matches 
the insertion key and the reference stays balanced — no extra state needed. 
Failed inits before the first success can still be retried.
   
   Thanks for the suggestion! That makes total sense.
   
   Rejecting re-initialization after a successful Init() keeps Channel simple 
without extra heap allocation or state tracking, while still allowing failed 
Init() attempts to be retried. I will update the PR to follow this approach.


-- 
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]

Reply via email to