@@ -253,6 +253,9 @@ namespace rpc
253253 const std::vector<rpc::back_channel_entry>& in_back_channel,
254254 std::vector<rpc::back_channel_entry>& out_back_channel)
255255 {
256+ bool no_local_add_ref = !!(build_out_param_channel & add_ref_options::build_caller_route)
257+ && !!(build_out_param_channel & add_ref_options::build_destination_route);
258+
256259 bool build_caller_channel = !!(build_out_param_channel & add_ref_options::build_caller_route);
257260 bool build_dest_channel = !!(build_out_param_channel & add_ref_options::build_destination_route)
258261 || build_out_param_channel == add_ref_options::normal
@@ -261,6 +264,18 @@ namespace rpc
261264 std::shared_ptr<rpc::transport> caller_transport;
262265 std::shared_ptr<rpc::transport> destination_transport;
263266
267+ RPC_INFO (" pass_through::add_ref zone={}, fwd={}, rev={}, dest={}, caller={}, options={}, build_dest={}, "
268+ " build_caller={}, no_local={}" ,
269+ zone_id_.get_val (),
270+ forward_destination_.get_val (),
271+ reverse_destination_.get_val (),
272+ destination_zone_id.get_val (),
273+ caller_zone_id.get_val (),
274+ static_cast <uint64_t >(build_out_param_channel),
275+ build_dest_channel,
276+ build_caller_channel,
277+ no_local_add_ref);
278+
264279 // Determine target transport based on destination_zone
265280 if (build_dest_channel)
266281 {
@@ -353,9 +368,7 @@ namespace rpc
353368
354369 // Use bitwise AND to check flags, not exact equality
355370 // because build_out_param_channel may have additional build flags
356- if (!!(build_out_param_channel & add_ref_options::build_destination_route)
357- && !!(build_out_param_channel & add_ref_options::build_caller_route)
358- && destination_zone_id.as_caller () == caller_zone_id)
371+ if (no_local_add_ref && destination_zone_id.as_caller () == caller_zone_id)
359372 {
360373 // this is a passthrough addref and should not be included in either count
361374 }
@@ -395,6 +408,14 @@ namespace rpc
395408 const std::vector<rpc::back_channel_entry>& in_back_channel,
396409 std::vector<rpc::back_channel_entry>& out_back_channel)
397410 {
411+ RPC_INFO (" pass_through::release zone={}, fwd={}, rev={}, dest={}, caller={}, options={}" ,
412+ zone_id_.get_val (),
413+ forward_destination_.get_val (),
414+ reverse_destination_.get_val (),
415+ destination_zone_id.get_val (),
416+ caller_zone_id.get_val (),
417+ static_cast <uint64_t >(options));
418+
398419 // Check if we're in the process of disconnecting
399420 if (status_.load (std::memory_order_acquire) == pass_through_status::DISCONNECTED)
400421 {
@@ -571,12 +592,11 @@ namespace rpc
571592 return ;
572593 }
573594
574- RPC_DEBUG (
575- " trigger_self_destruction: Initiating pass-through destruction , forward_dest={}, reverse_dest={}, pt ={}, "
576- " shared={}, optimistic={}, function_count={} " ,
595+ RPC_INFO (
596+ " pass_through: deleting, zone={} , forward_dest={}, reverse_dest={}, shared ={}, optimistic={}, active={} " ,
597+ zone_id_. get_val () ,
577598 forward_destination_.get_val (),
578599 reverse_destination_.get_val (),
579- (void *)this ,
580600 shared_count_.load (),
581601 optimistic_count_.load (),
582602 function_count_.load ());
0 commit comments