Skip to content

Commit

Permalink
Move client IO task into a struct (oxidecomputer#1124)
Browse files Browse the repository at this point in the history
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
mkeeter authored Jan 30, 2024
1 parent f9fc36b commit 1325543
Show file tree
Hide file tree
Showing 2 changed files with 317 additions and 210 deletions.
Loading

0 comments on commit 1325543

Please sign in to comment.