-
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
fix: node discovery extended, empty host info bug fixed, logging enhanced #121
Conversation
5b4cfda
to
0e7f106
Compare
…sk refactored to process chunks
46ac595
to
7ff0257
Compare
fd8225a
to
b3bd5e5
Compare
b3bd5e5
to
5c4b7cc
Compare
src/services/NodeMonitor.ts
Outdated
|
||
for (const nodes of nodeListChunks) { | ||
logger.info(`Getting node info for chunk of ${nodes.length} nodes`); | ||
await runTaskInChunks(this.nodeList, this.nodePeersChunkSize, logger, 'fetchAndAddNodeListPeers', async (nodes) => { |
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.
The this.nodeList
will contain all types of nodes.
Should it just use apiNodeList
instead of this.nodeList
to request the NodePeers?
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.
Interesting, I specifically created the apiNodeList
for this use, must have been regressed during the refactoring, fixed now.
}); | ||
logger.info(`[getNodeList] Nodes count from DB: ${nodesFromDb.length}`); | ||
// adding the nodes from DB to the node list | ||
this.addNodesToList(nodesFromDb); |
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.
Seems like dead / disconnected nodes can stay in the list forever, or do we exclude them?
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.
It's a known issue, explained in the PR description, addressed in issue #122
Look good mate. but I believe we need this solution asap #122.
|
@@ -17,6 +17,8 @@ | |||
"PEER_NODE_PORT": 7900, | |||
"REQUEST_TIMEOUT": 5000, | |||
"NUMBER_OF_NODE_REQUEST_CHUNK": 10, | |||
"NODE_PEERS_REQUEST_CHUNK_SIZE": 50, | |||
"CHAIN_HEIGHT_REQUEST_CHUNK_SIZE": 10, | |||
"PREFERRED_NODES": ["*.symboldev.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.
Is this correct naming?
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.
As we discussed in the discord, here is the issue created. #125
fixes #120
What was the issue?
As described in issue #120 Statistics-service was not able to discover and list all the nodes in the network. It was using some static node list in the configuration to query the
node/peers
and those queries were being fired at the same time therefore most of them was timing out.What's the fix?
node/peers
API calls in this large list.node/peers
endpoint in chunks now, handling the next chunk after the current one is complete, the default chunk size is 50, but it's configurable through the env varNODE_PEERS_REQUEST_CHUNK_SIZE