Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move client IO task into a struct (oxidecomputer#1124)
This PR moves the client IO task from a function (with 9 arguments and an `#[allow(clippy::too_many_arguments)] ` annotation) into a `struct ClientIoTask`. In addition, there are two logical changes: - The rx task is moved into a `struct ClientRxTask` with an `impl Drop` that ensures that we abort that task if it did not stop on its own. There were previously paths where we exited the IO task without aborting the rx task, e.g. [here](https://github.com/oxidecomputer/crucible/blob/f9fc36ba/upstairs/src/client.rs#L2606) - Sending a message can now be interrupted by the `stop` oneshot or the rx task timeout. This prevents a lock-up that @leftwo noticed, where we'd get stuck [here](https://github.com/oxidecomputer/crucible/blob/f9fc36ba/upstairs/src/client.rs#L2582) forever.
- Loading branch information