Skip to content

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

Merged
algorandskiy merged 11 commits into
algorand:masterfrom
algorandskiy:pavel/setrlimit-non-relay
Feb 1, 2023
Merged

algod: split SetFdSoftLimit calls for relay and non-relay nodes#5070
algorandskiy merged 11 commits into
algorand:masterfrom
algorandskiy:pavel/setrlimit-non-relay

Conversation

@algorandskiy
Copy link
Copy Markdown
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
Copy Markdown

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

Comment thread daemon/algod/server.go
Comment thread util/util_windows.go Outdated
Comment thread config/localTemplate.go
Comment thread network/wsNetwork.go Outdated
brianolson
brianolson previously approved these changes Jan 31, 2023
Comment thread daemon/algod/server.go
Comment thread daemon/algod/server.go
@algorandskiy algorandskiy reopened this Feb 1, 2023
Comment thread config/localTemplate.go
@algorandskiy algorandskiy requested a review from cce February 1, 2023 14:24
Comment thread daemon/algod/server.go
Comment thread util/util_windows.go Outdated
@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
Copy Markdown
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
Comment thread daemon/algod/server.go
}
if cfg.IsGossipServer() {
var ot basics.OverflowTracker
fdRequired := ot.Add(fdRequired, uint64(cfg.IncomingConnectionsLimit))
Copy link
Copy Markdown
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)

@algorandskiy algorandskiy deleted the pavel/setrlimit-non-relay branch March 16, 2026 20:06
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