Skip to content

tor-proto: Ensure rx end of chan reactor output sink is not dropped in test.

gabi-250 requested to merge gabi-250/arti:test_extend_ntor-fix into main

This hopefully fixes #1832 (closed).

I haven't been able to repro the failure from #1832 (closed) locally, but judging from the logs, I suspect it's triggered by interleavings like:

  • extend_fut executes up until circ.extend_ntor(..).await, where it's blocked awaiting a completion notification from the circuit reactor
  • reply_fut starts running:
    • CircuitExtender installs a meta-handler in the circuit reactor, and waits for an EXTENDED2 cell
    • test_extend() reads a cell from the receiving end of the fake channel's output sink (rx)
    • test_extend() sends the EXTENDED2 cell to the circuit reactor over CircuitRxSender
    • rx is dropped
  • reply_fut completes
  • in the channel reactor's run_once(), select_biased! resolves to an error, because the receiving end of the output sink (rx) was dropped. The reactor logs got sink error: SendError { kind: Disconnected } (see SendError), and exits
  • the circuit reactor exits too, because the receiving end of its chan_sender (which was in the channel reactor) was dropped

Returning the rx of the fake channel's output sink from reply_fut should stop it from being dropped, and fix #1832 (closed).

Merge request reports

Loading