Skip to content
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(network): use goroutines for sending streams #1365

Merged
merged 2 commits into from
Jun 25, 2024

Conversation

b00f
Copy link
Collaborator

@b00f b00f commented Jun 25, 2024

Description

We had a known issue that happened occasionally. Sometimes
the nodes would lag for a minute and then start syncing. This PR fixes this issue.
The main reason was that once SendTo blocked (for any reason), the receiving loop also got stuck.
Here, we send messages asynchronously to ensure the receiving loop doesn't get blocked.

Copy link

codecov bot commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.

Project coverage is 77.32%. Comparing base (20e991a) to head (cd0974b).
Report is 43 commits behind head on main.

Current head cd0974b differs from pull request most recent head 9d489c4

Please upload reports for the commit 9d489c4 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1365      +/-   ##
==========================================
+ Coverage   76.05%   77.32%   +1.26%     
==========================================
  Files         206      233      +27     
  Lines       10672    11941    +1269     
==========================================
+ Hits         8117     9233    +1116     
- Misses       2169     2290     +121     
- Partials      386      418      +32     

go func() {
err := n.gossip.Broadcast(msg, topicID)
if err != nil {
n.logger.Error("error on broadcasting msg", "error", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it Warn

@themantre themantre merged commit 17dc771 into pactus-project:main Jun 25, 2024
10 checks passed
@b00f b00f deleted the fix/network-lag branch September 4, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants