-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Periodic Bootstraps #229
Periodic Bootstraps #229
Conversation
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #229 +/- ##
==========================================
- Coverage 27.69% 27.24% -0.45%
==========================================
Files 22 22
Lines 5839 5938 +99
==========================================
+ Hits 1617 1618 +1
- Misses 4222 4320 +98
☔ View full report in Codecov by Sentry. |
feda8c8
to
0c923fe
Compare
0c923fe
to
4ae038f
Compare
for cmd in commands { | ||
if self.sender.send(cmd).await.is_err() { | ||
return NumSuccPut(0); | ||
} | ||
} |
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.
Wouldn't this block if there are more than 100 batches, since its not in separate thread, receive will not happen until everything is sent?
}; | ||
// drop tx manually, | ||
// ensure that only senders in spawned threads are still in use | ||
drop(tx); |
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 guess if we move first reference into separate thread this won't be needed.
.filter(|(_, qd)| { | ||
!matches!(qd.status, QueryStatus::Pending) | ||
}) |
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.
Maybe simpler qd.status != QueryStatus::Pending
?
.filter(|(_, &qd)| { | ||
matches!(qd.status, QueryStatus::Succeeded) | ||
}) |
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.
Same here since there is no need for complex pattern match?
This PR adds periodic bootstraps, as per libp2p KAD specification Intervals are part of the LC configuration.
Other changes: