-
Notifications
You must be signed in to change notification settings - Fork 5
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
Client Connection Loss to Agent Exception #276
Comments
@joshuakarp should this part of our feature freeze? |
Originally I was seeing this as quite low priority, and so not necessary for the feature freeze. But this might actually be quite useful for our own usage of Polykey when deployed on AWS. Thoughts? |
A quick way to solve this is to move all of our comment descriptions of the exceptions into the actual We just need to add a test into our bin code to test this behaviour, the command it should centralise on is |
a |
Currently This may look like a @ready(new ErrorClientClientConnection)
public async with<T>(f:(clien: ClientInterface) => Promise<T>) {
try {
return f(this as ClientInterface);
} catch (err) {
if(err typeof someError) {
// Was a connection failure
await this.destroy()
throw new ErrorClientClientConnection;
}
// otherwise
throw err
}
} |
I suggest a single GRPC connection error exception that is out into grpc/errors.ts. This is better than creating separate exceptions in client and agent domains. It can be rethrown as NodeConnectionError to be more specific later if need be. |
Oh wait I re-read the issue and therefore to might make sense to catch and specialise it to client domain error or agent domain error. Because certain ops will do a client call that does a agent call. So being able to specialise ErrorGRPCConnection to ErrorClientConnection and ErrorAgentConnectiom can be useful. This is just pseudo names btw. |
Can you flesh out the task list in this issue based on what we want to end up doing. |
#310 enables the ability to resolve this issue, but this would have to be addressed in a later PR following #276 (comment) |
The This means any usage of However we may want to propagate it up all the way to the |
The original spec relies alot on the way GRPC worked. GRPC isn't relevant anymore as we changed to using js-rpc on https://github.com/MatrixAI/Polykey/tree/4ddd9dd726995e4431a09b26b764f5d53fd5e4ac (October the 6th 2023). However having good errors is still a good idea, so we should verify this behaviour later. @tegefaulkes |
Specification
When the PK CLI or GUI loses connection to the agent, there should be a domain level exception in
src/client/errors.ts
and also a good human readable message.2 existing exceptions are at play here:
These should be caught in the
src/client
somewhere, and then handled by thesrc/bin
commands.That way we can always know that it's a connection error.
Existing bin scripts already catch the above
ErrorGRPCClient...
but they should be catchingErrorClientClientConnection
. I think both grpc timeouts and grpc connection errors lead to the same result from theclient
domain perspective.Additional context
network
domain at all, this is directly fromsrc/client
andsrc/grpc
.GRPCClient
derived classes andNodeConnection
toStartStop
pattern #333 - Need to deal with GRPCClient and derived classes becomingStartStop
patternTasks
The text was updated successfully, but these errors were encountered: