-
Notifications
You must be signed in to change notification settings - Fork 45
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
Fix vpn client #901
Fix vpn client #901
Conversation
We update the retirer to not retry till success anymore. We only retry three times.
We whitelist errors sent from server hello as it's pointless to retry.
The commit contains changes to the logic of AppStates(). We are removing the connection summary check as whenever a vpn-client gets an error it closes all the connections to retry again. Because of this even when the vpn-client is still running AppStates() gives the app status for vpn-client as stopped. Insted depending on ProcByName() is sufficient.
The commit contains additions to the proc and rpc code. The addition is of the app status AppStatusErrored that is set if there is an entry in statusErr which is set if the app encounters an error and stops. A . The commit only makes required changes in vpn-client to set the error.
This commit contains updates to MockRPCIngressClient after the changes to RPCIngressClient in previous commit. The code was auto generated via mockery.
This commit contains nolint:errcheck wherever the return value from a func was not checked to suppress warnings.
This commit removes log that was used for testing.
CMIIW, I actually think that the So we can eliminate |
|
The commit changes SetDetailedStatusError to SetError as it was confusing and SetError is nore consise and accurate.
@alexadhy I went through the code again and removing |
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.
Just a few questions from my end. It seems like there may be a better way to handle processes so we do not need to set status and errors separately but its not the task of the PR to rewrite the whole library. So apart from the questions this looks good.
The commit contains a transport check in vpn-client. Before dialing the routes the available transports to the server are checked. If there is none then we send a ErrTransportNotFound. ErrTransportNotFound is whitelisted in the dail retrier.
The commit contains updated error for unknown code, aErr changed to appErr, removed switch statements and whitelisted ErrTransportNotFound in main retrier.
Should I add a max no of retries to the retrier of |
The commit removes the retrier in dialServer as it's redundant and the same job can be done by the main retrier.
The commit adds RPCErr struct that is used to preserve the type of the error from RPC. Currelty only the err of Dial() is wrapped with it.
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.
Functionality work as well as possible, and code was clear, and just one little comment.
The commit updates the checkIfTransportAvalailable to check if any transports are established for the visor and not if there is a transport between local and remote visor. checkIfTransportAvalailable also sends a new error ErrNoTransportFound if no transports are established for the visor. Both ErrTransportNotFound and ErrNoTransportFound are whitelisted as ErrTransportNotFound is received from router whenever it is unsuccessful at creating a route to the remote visor..
The commit changes the lock in SetError() from RLock to Lock.
Did you run
make format && make check
?yes
Fixes #783
Fixes #900
Changes:
AppStatusErrored
:"status": 2
which gives the error insidedetailed_status
RPCErr
to preserve the type of the error we return via RPC (as suggested by @alexadhy)How to test this PR:
Test #783
http://localhost:8000/api/visors/<pk>/summary
and see ifvpn-client
hasTest #900
http://localhost:8000/api/visors/<pk>/summary
and see ifvpn-client
has