tor-proto: Ensure rx end of chan reactor output sink is not dropped in test.
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 untilcirc.extend_ntor(..).await
, where it's blockedawait
ing a completion notification from the circuit reactor -
reply_fut
starts running:-
CircuitExtender
installs a meta-handler in the circuit reactor, and waits for anEXTENDED2
cell -
test_extend()
reads a cell from the receiving end of the fake channel's output sink (rx
) -
test_extend()
sends theEXTENDED2
cell to the circuit reactor overCircuitRxSender
-
rx
is dropped
-
-
reply_fut
completes - in the channel reactor's
run_once()
,select_biased!
resolves to an error, because the receiving end of theoutput
sink (rx
) was dropped. The reactor logsgot sink error: SendError { kind: Disconnected }
(seeSendError
), 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).