-
Notifications
You must be signed in to change notification settings - Fork 65
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
Make initial connection check optional #75
Conversation
After reviewing the code, it potentially makes sense for this to be part of the |
I have looked at this as part of a rewrite of the connection handling system, and the latest master now has the ability for nodes to come and go. To enable it, add the parameter This code impacts a number of critical areas, so won't be released for a while, but if you can test it out against master and provide any feedback it would be appreciated. |
It's unfortunately the same "problem" as for the initial commit. I'm doing all that error handling and liveness checks on my side to have better control over client connections. I'm actually not sure what you're trying to achieve with these forced extra layers of checks.. All that liveness checks are really bad for situations where you hold like 40 or 50 client connections. |
I can expose the method to update the status if you like.
At current this should be 1 request every 30 seconds, to an endpoint that is returning a small amount of data. Are you seeing more than that?
When you say RPC level you mean the REST responses? These should be returned already, assuming that the connection is present. Also, I want to keep the protocol somewhat abstracted so don't want to be passing back connection-level errors (for example) beyond what is obtained during the setup phase.
Each endpoint has a check in place, which requires the connection to either be active or synced. Are there any calls you are seeing that have a synced check when it should just be an active check? |
I think that'd help a lot 👍 It might be worth adding a callback so the application can react to connection losses, but polling the exposed
Yea, you're right. I've thought you were doing the whole connection check as done before (including static values checks). which would be very heavy when done periodically.
I think that's the root case of our discussion :D However, after reviewing your changes again, I think that's actually a good middle way. |
Thanks for the additional info and thoughts. I have added a public I'm considering having different check intervals depending on the state of the connection, for example if the connection is down/desynced then ping it more frequently to find out if it is up/synced. That said, exposing |
Functionality now available in the library. |
I've added an additional parameter which can be used to disable the initial connection check:
This is useful when interacting with clients in early testnets, that might not fully follow the specs yet.
Even with these inconsistencies, I'd like to use these clients for other queries and would like to do this kind of error handling myself when necessary.
The forced initial check currently prevents these clients from being used via this library.
I've also made the DVT check optional and changed visibility of the optional code for max flexibility :)
This way, everyone can decide himself which checks are necessary if the built in defaults don't fit the individual needs.
The default behavior of this library is still the same, as the connection & DVT checks are enabled by default.