Skip to content
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(manager): use rpc to check if a node is running or not #1887

Closed
wants to merge 1 commit into from

Conversation

RolandSherwin
Copy link
Member

  • After a reboot, the PID of the service might be taken by some other process and if we use the PID to check if our node is active, then we'd get positive there, but would fail when we try to access the RPC endpoint.
  • So just try to connect to the RPC endpoint to see if the node is currently active or not
  • Does this in parallel, as a connection failure will take 3 seconds to return.

- Afer a reboot, the pid of the service might be taken by some other
  process and if we use the pid to check if our node is active, then
  we'd get positive there, but would fail when we try to access the rpc
  endpoint.
- So just try to connect to the rpc endpoint to see if the node is
  currently active or not
@jacderida
Copy link
Contributor

Hey Roland,

Good point about the restarts, but people in the community have noted issues with excessive CPU usage when using the RPC service. We may want to just think about this one. I seem to remember I made changes for looking up the location of the exe for the process, which was unique, because each exe has its own service directory. We might be able to do this after restart?

@RolandSherwin
Copy link
Member Author

Hey @jacderida, that sounds good too. So do we know for sure that RPC is causing issues? It is just a tiny webserver that we rarely send requests to.

@jacderida
Copy link
Contributor

I've had quite a few messages saying that it seems to spike CPU usage, and in turn that may be what is causing the node manager to take so long to refresh a large number of nodes. I have never had time to properly investigate and determine whether it is the real cause of the spikes, so I can't say for sure.

I have just had another thought though: if we are simply just checking the connection here, as opposed to running one of the commands, maybe that might be OK.

@RolandSherwin
Copy link
Member Author

RolandSherwin commented Jun 18, 2024

Right I see.

I'm okay with either approach. Just one thing to keep in mind is the time it'd take to refresh many nodes.
The current method by checking the connection take 3 seconds to respond back if the node is down, i.e., rpc server is inactive. This is without any retry and by just checking for connection.
So I had to do perform the checks in parallel for 50 nodes at a time.

But with your approach, I think even if we do it sequentially, we'd finish within a couple ms. In that case, we can go with yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants