-
Notifications
You must be signed in to change notification settings - Fork 881
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
Add an explicit flag to join network in diagnostic #2087
Conversation
e32f826
to
09703dd
Compare
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 with one q.
networkPeers = fetchNodePeers(*ipPtr, *portPtr, *networkPtr) | ||
joinedNetwork = true | ||
if len(networkPeers) == 0 { | ||
logrus.Warnf("There is no peer on network %q, check the network ID, and verify that is the non truncated version", *networkPtr) |
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.
Is it safe to continue here rather than exit with fatalf?
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.
yep it is, the output will only show no peers on the network and the validation with the entries will show a warning like:
WARN[0000] The element with key:23591a2e3795dc36c994eae6074239c91a9e647784af374cea1abf33373acb07 does not belong to any node on this network
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.
ok .. thanks!
Codecov Report
@@ Coverage Diff @@
## master #2087 +/- ##
=========================================
Coverage ? 40.39%
=========================================
Files ? 139
Lines ? 22352
Branches ? 0
=========================================
Hits ? 9028
Misses ? 11997
Partials ? 1327 Continue to review full report at Codecov.
|
09703dd
to
01c9b8a
Compare
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
cmd/diagnostic/README.md
Outdated
@@ -199,8 +199,18 @@ The following flags are supported: | |||
| -ip <string> | The IP address to query. Defaults to 127.0.0.1. | | |||
| -net <string> | The target network ID. | | |||
| -port <int> | The target port. (default port is 2000) | | |||
| -a | join/leave network | |
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 minor nit: change join
to Join
to align with the descriptions above and below.
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.
done
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
01c9b8a
to
acff1b5
Compare
Usually a diagnostic session wants to check the local state without this flag the network is joined and left every iteration altering actually the daemon status. Also if the diagnostic client is used against a live node, the network leave has a very bad side effect of kicking the node out of the network killing its internal status. For the above reason introducing the flag -a to be explicit so that the current state is always preserved Signed-off-by: Flavio Crisciani <[email protected]>
acff1b5
to
47c28fe
Compare
Usually a diagnostic session wants to check the local state
without this flag the network is joined and left every iteration
altering actually the daemon status.
Also if the diagnostic client is used against a live node, the
network leave has a very bad side effect of kicking the node
out of the network killing its internal status.
For the above reason introducing the flag -a to be explicit
so that the current state is always preserved
Signed-off-by: Flavio Crisciani [email protected]