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

algod: split SetFdSoftLimit calls for relay and non-relay nodes #5070

Merged
merged 11 commits into from
Feb 1, 2023

Conversation

algorandskiy
Copy link
Contributor

Summary

algod sets RLIMIT_NOFILE to max possible value on startup. This might result the node failure on startup especially if it is a non-relaying node and does not need to listen for thousands of incoming connections.

Additionally enhanced config test since I opened the file:

  • Replace shared "tempdir" by t.TempDir
  • Make them parallel
  • Make test naming consistent

Test Plan

New test for IsGossipServer config helper. Existing tests for everything else.

* Replace shared "tempdir" by t.TempDir
* Make them parallel
* Make test naming consistent
@codecov
Copy link

codecov bot commented Jan 27, 2023

Codecov Report

Merging #5070 (7215a3e) into master (26a860f) will decrease coverage by 0.02%.
The diff coverage is 38.00%.

@@            Coverage Diff             @@
##           master    #5070      +/-   ##
==========================================
- Coverage   53.58%   53.56%   -0.02%     
==========================================
  Files         430      430              
  Lines       54088    54131      +43     
==========================================
+ Hits        28984    28997      +13     
- Misses      22860    22889      +29     
- Partials     2244     2245       +1     
Impacted Files Coverage Δ
daemon/algod/server.go 4.12% <0.00%> (-0.51%) ⬇️
util/util.go 0.00% <0.00%> (ø)
config/localTemplate.go 63.26% <100.00%> (+19.51%) ⬆️
network/wsNetwork.go 64.74% <100.00%> (ø)
ledger/tracker.go 74.26% <0.00%> (-4.65%) ⬇️
ledger/testing/randomAccounts.go 55.65% <0.00%> (-0.62%) ⬇️
ledger/catchpointtracker.go 58.49% <0.00%> (ø)
ledger/acctupdates.go 68.99% <0.00%> (+0.24%) ⬆️
catchup/service.go 69.80% <0.00%> (+0.48%) ⬆️
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

util/util_windows.go Outdated Show resolved Hide resolved
network/wsNetwork.go Outdated Show resolved Hide resolved
brianolson
brianolson previously approved these changes Jan 31, 2023
@algorandskiy algorandskiy reopened this Feb 1, 2023
config/localTemplate.go Outdated Show resolved Hide resolved
@algorandskiy algorandskiy requested a review from cce February 1, 2023 14:24
util/util_windows.go Outdated Show resolved Hide resolved
@algorandskiy algorandskiy force-pushed the pavel/setrlimit-non-relay branch from 3e44bdd to 8d2cf28 Compare February 1, 2023 15:54
cce
cce previously approved these changes Feb 1, 2023
@bbroder-algo
Copy link
Contributor

the adjustment logic looks good only remains to be seen that the windows build still operates as expected

@algorandskiy algorandskiy changed the title network: set SetFdSoftLimit for relaying nodes in wsNetwork algod: split SetFdSoftLimit calls for relay and non-relay nodes Feb 1, 2023
@algorandskiy algorandskiy merged commit 4e652f2 into algorand:master Feb 1, 2023
}
err = util.SetFdSoftLimit(fdRequired)
if err != nil {
return fmt.Errorf("Initialize() err: %w", err)
}
if cfg.IsGossipServer() {
var ot basics.OverflowTracker
fdRequired := ot.Add(fdRequired, uint64(cfg.IncomingConnectionsLimit))
Copy link
Contributor

Choose a reason for hiding this comment

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

this shadows fdRequired declared above (but is OK since the original is not used later)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants