-
Notifications
You must be signed in to change notification settings - Fork 919
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
feat(share/p2p/discovery): Warning for discovery loop if haven't found wanted peers in 5 minutes #2573
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2573 +/- ##
==========================================
- Coverage 51.33% 51.16% -0.17%
==========================================
Files 158 158
Lines 10512 10520 +8
==========================================
- Hits 5396 5383 -13
- Misses 4645 4662 +17
- Partials 471 475 +4
|
Good afternoon |
Github duplicated my review, but then removed one of the copies. I've hided one, but it is still relevant. Please check it out in #2573 (review). Comments also visible from changes preview page. |
We can also add to the output how many peers are connected |
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.
Need to fix some nits with comments and it is good.
log.Warnf("Discovery loop is running but can't find enough peers. Found: %d, Required: %d", d.metrics.discoveryAmountOfPeers, requiredAmountOfPeers)
We can also add to the output how many peers are connected
Up to you, but if you go with this, please use d.set.Size()
and d.set.Limit()
values instead of what you mentioned in example
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.
I know it feels exhausting, but we almost there! 🚀 Last nit:
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.
Last nit
In fact, I would like to express my deep gratitude to you for all the comments and interactions with us here. For the first time we decided to make a contribution through interaction with the project code, and for us this is a great experience. Partly because of this, we can show that I am a little slow in understanding. It is important for us to understand exactly how interaction with development teams takes place in such large projects. Thank you very much for this, the next PR will be of better quality. |
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! Thank you for contribution!
@nodersteam, lint is failing |
Thank you, I found the cause, I'm already fixing it |
@Wondertan I see that Lint is falling again, I will fix everything tomorrow and make a correct commit. I'm sorry for this |
…d wanted peers in 5 minutes (celestiaorg#2573) (cherry picked from commit 4b96022)
refactor: Enhance peer discovery loop with connectivity warning
This commit refactors the
discoveryLoop
function in theDiscovery
structto include a connectivity warning timer. The timer is set to trigger every
5 minutes and checks if the number of discovered peers has not reached the
desired limit. If the limit is not met, a warning message is logged to
indicate potentially degraded connectivity.
Changes:
discoveryLoop
function.This enhancement improves the monitoring and reporting of connectivity issues
during the peer discovery process.
Closes #2474