File tree Expand file tree Collapse file tree 4 files changed +21
-1
lines changed
apps/freenet-ping/app/tests Expand file tree Collapse file tree 4 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -831,8 +831,12 @@ async fn test_ping_blocked_peers_simple() -> TestResult {
831831// as they only varied in non-functional aspects like timeouts and logging
832832
833833/// Solution/reference implementation for blocked peers
834+ // TODO-MUST-FIX: WebSocket connection reset during teardown - see issue #2108
835+ // Test passes functionally (PUT/GET/Subscribe/state propagation all work) but
836+ // fails with "Connection reset without closing handshake" during cleanup.
837+ // Likely a test teardown race rather than functional bug.
834838#[ tokio:: test( flavor = "multi_thread" ) ]
835- #[ ignore = "fix me" ]
839+ #[ ignore]
836840async fn test_ping_blocked_peers_solution ( ) -> TestResult {
837841 run_blocked_peers_test ( BlockedPeersConfig {
838842 test_name : "solution" ,
Original file line number Diff line number Diff line change @@ -976,6 +976,13 @@ impl P2pConnManager {
976976 } => {
977977 tracing:: debug!( %tx, %key, "local subscribe complete" ) ;
978978
979+ // If this is a child operation, complete it and let the parent flow handle result delivery.
980+ if op_manager. is_sub_operation ( tx) {
981+ tracing:: info!( %tx, %key, "completing child subscribe operation" ) ;
982+ op_manager. completed ( tx) ;
983+ continue ;
984+ }
985+
979986 if !op_manager. is_sub_operation ( tx) {
980987 let response = Ok ( HostResponse :: ContractResponse (
981988 ContractResponse :: SubscribeResponse { key, subscribed } ,
Original file line number Diff line number Diff line change @@ -126,9 +126,11 @@ where
126126 "root operation awaiting child completion"
127127 ) ;
128128
129+ // Track the root op so child completions can finish it later.
129130 op_manager
130131 . root_ops_awaiting_sub_ops ( )
131132 . insert ( tx_id, final_state) ;
133+ tracing:: info!( %tx_id, "root operation registered as awaiting sub-ops" ) ;
132134
133135 return Ok ( None ) ;
134136 }
Original file line number Diff line number Diff line change @@ -423,6 +423,13 @@ impl ConnectionManager {
423423 self . transient_connections . contains_key ( peer)
424424 }
425425
426+ #[ allow( dead_code) ]
427+ pub fn is_transient_addr ( & self , addr : & SocketAddr ) -> bool {
428+ self . transient_connections
429+ . iter ( )
430+ . any ( |entry| entry. key ( ) . addr == * addr)
431+ }
432+
426433 pub fn transient_count ( & self ) -> usize {
427434 self . transient_in_use . load ( Ordering :: Acquire )
428435 }
You can’t perform that action at this time.
0 commit comments