-
Notifications
You must be signed in to change notification settings - Fork 22
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
Make the node open its ports before doing discovery() #1118
Conversation
We really need that |
All the calls in the |
I'll rename the commit and change the description. |
1fc236b
to
a177eac
Compare
Codecov Report
@@ Coverage Diff @@
## v0.x.x #1118 +/- ##
==========================================
+ Coverage 77.11% 78.56% +1.45%
==========================================
Files 83 84 +1
Lines 7961 7978 +17
==========================================
+ Hits 6139 6268 +129
+ Misses 1822 1710 -112
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
The runTask() call will spawn a new fiber and and switch to the new fiber immediately. However we want to start listening for incoming requests before doing network discovery. Using setTimer with a zero timeout (a.k.a. schedule()) makes the node open a listening port right away, rather than waiting for the first discovery round to complete. It increases the node's connectivity to other nodes which may want to establish a connection, and consequently reduces CI failures. Part of: bosagora#1117
cc8cbb8
to
28b4b06
Compare
The issue wasn't really about asynchronicity, it was about scheduling. The But we want Fixed the description. |
With your explanation, I've just realized that this is about scheduling and just seen the log shown in #1117. Thanks for the detailed explanation. |
Thanks. I'll merge it with the approval. |
Another small part towards fixing #1117.