-
Notifications
You must be signed in to change notification settings - Fork 402
fix(gui-client): catch IPC connection dropouts as fatal errors #5795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
test/multi-process-test
This unblocks some issues that need the IPC connection to be up
This reverts commit c2bdebd.
conectado
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work fixing this, just left a few question/comments but nothing major
| Req::Ipc(result) => match result { | ||
| Some(Ok(msg)) => if let Err(error) = self.handle_ipc(msg).await { | ||
| tracing::error!(?error, "`handle_ipc` failed"); | ||
| } | ||
| Some(Err(error)) => { | ||
| tracing::error!(?error, "IPC read failure"); | ||
| Err(Error::IpcRead)? | ||
| } | ||
| None => Err(Error::IpcClosed)?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's clearer if you match directly over the result and reduce the indentation level, like:
Req::Ipc(Some(Ok(msg)) => {...}
Req::Ipc(Some(Err(Error)) => {...}
...| ctlr_tx.send(ControllerRequest::Ipc(msg)).await?; | ||
| loop { | ||
| let result = rx.next().await; | ||
| ctlr_tx.send(ControllerRequest::Ipc(result)).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're depending on ctlr_tx being closed here some time after the channel in the line above is closed? But I would rather we use the while let(...) and explicitly inform ctlrx_tx about the channel closing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and so we don't have to deal with deeply nested types like ControllerRequest<Result<Option<IpcServerMessage>>>
Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
…pdating' into chore/catch-ipc-rx-error
Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
conectado
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Closes #5760, refs #5790
Also removes some redundant IPC-related code that was nearby.
If you stop the IPC service, e.g. due to an update on Linux, it will say "IPC connection closed". This isn't ideal but at least the Client does catch it now, instead of failing on the next IPC send.