-
Notifications
You must be signed in to change notification settings - Fork 185
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
snode communication and logging clean up #2 & AppDotNot minor refactor #988
Conversation
…SnodeAddress so they can't stack, markRandomNodeUnreachable returns remaining count, adjust logging
… simplify parameters, logging improvements
…tion, improve logging
ideally the code should never ever ever touch |
await conversation.updateSwarmNodes(filteredNodes); | ||
return filteredNodes; | ||
} | ||
|
||
markRandomNodeUnreachable(snode) { |
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 name doesn't seem to suggest that it would return something. I see that randomSnodePool.lenght
is only used for logging, why not log inside markRandomNodeUnreachable
? Like "Marked {} as unreachable, {} left in the pool". Then you can have another log message one level above telling the reason (which can be different from what I can see).
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 mainly to reduce the number of logging messages. I had that way initially but we already log everytime this is called as it's a p. big deal event and the outer context is more important that the fact a node was removed but it is VERY helpful to know how main are left to ensure roll overs are happening as expected.
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.
If you don't want two separate log messages, how about we make another call to getRandomSnodePool()
to get the size? (Or add another method to just get the size, without potentially calling initialiseRandomPool
.)
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.
well both actions need to happen the banning of the node and getting the remaining count. Is it the name of the function that is the issue?
A compromise maybe the two function solution but seems a bit inefficient, since banning the node needs to happen and knows the count. But I guess it is just a member variable it needs to count, so not as bad as the unreachableNode
node situation.
I'll just split for now. Due to the time crunch of trying to get this in for 1.0.5, I'll leave a temp variable in for now and clean it up later.
js/modules/loki_snode_api.js
Outdated
} else { | ||
log.error('loki_snodes: Giving up trying to contact seed node'); | ||
if (snodes.length === 0) { | ||
throw new window.textsecure.SeedNodeError( |
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.
Don't we need to reset this.initialiseRandomPoolPromise
here?
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.
Yes
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.
minor things
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.
Looks good
overall:
snode stuff:
adn stuff: