Skip to content

PUT operations with auto-subscribe children don't deliver completion to client #2106

@sanity

Description

@sanity

Problem

In test_ping_blocked_peers_solution (currently #[ignore]), gateway PUT times out waiting for response even though the operation completes successfully on the node side.

Symptoms

From test logs:

  • Gateway PUT starts, caches state, forwards (to self), seeds contract
  • Child auto-subscribe spawned (transaction 01KAA6JC...) for parent PUT (01KAA6J...)
  • Inbound RequestPut processed without errors
  • Child subscribe created via start_subscription_request
  • Session actor logs: "No clients waiting for transaction result: 01KAA6JC..." (expected - client waits on parent)
  • Parent PUT never delivers result to WebSocket client
  • wait_for_put_response times out

Root Cause Hypothesis

When child subscribe completes, parent PUT is not marked completed/delivered. The completion flow:

  1. handle_op_result should place parent in root_ops_awaiting_sub_ops
  2. OpManager::completed(child) should remove parent from awaiting
  3. Spawn parent result delivery

Something in this flow is broken - either:

  • Parent never makes it into root_ops_awaiting_sub_ops, OR
  • Child completion doesn't trigger parent cleanup, OR
  • Parent result delivery fails

Relevant Code

  • crates/core/src/operations/put.rs - PUT operation handling
  • crates/core/src/node/op_state_manager.rs - root_ops_awaiting_sub_ops tracking
  • start_subscription_request - auto-subscribe creation
  • OpManager::completed - child completion handling

Discovered During

Work on #2021 (blocked peers fix). This is a pre-existing bug - main branch fails the test even earlier (contract loading), but with that fixed, this PUT bug is exposed.

Testing

Run: cargo test test_ping_blocked_peers_solution -- --ignored --nocapture

Test is currently #[ignore] until this bug is fixed.

Impact

Blocks completion of #2021 test validation. May affect other PUT operations with child subscribes in production.

Metadata

Metadata

Assignees

Labels

A-networkingArea: Networking, ring protocol, peer discoveryE-mediumExperience needed to fix/implement: Medium / intermediateP-highHigh priorityT-bugType: Something is broken

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions