Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Better handling of TCP accept overflow #1638

Merged
merged 3 commits into from
Jan 28, 2019
Merged

Better handling of TCP accept overflow #1638

merged 3 commits into from
Jan 28, 2019

Conversation

rkeene
Copy link
Contributor

@rkeene rkeene commented Jan 25, 2019

Currently when we overflow the number of concurrent TCP sockets
we wish to service we accept them then immediately disconnect.
This change causes us to defer accepting new connections until we
are ready for them, relying instead on the OS socket backlog to
queue TCP handshakes until full, then stop processing new
connections when the backlog is full.

We use the I/O threads for scheduling all but one accept, so this
keeps the same thread affinity.

Currently when we overflow the number of concurrent TCP sockets
we wish to service we accept them then immediately disconnect.
This change causes us to defer accepting new connections until we
are ready for them, relying instead on the OS socket backlog to
queue TCP handshakes until full, then stop processing new
connections when the backlog is full.

We use the I/O threads for scheduling all but one accept, so this
keeps the same thread affinity.
@rkeene rkeene added the functionality quality improvements This item indicates the need for or supplies a better way to implement existing functionality label Jan 25, 2019
@rkeene rkeene self-assigned this Jan 25, 2019
@rkeene rkeene added this to the V18.0 milestone Jan 25, 2019
@cryptocode
Copy link
Contributor

Seems like we should be checking ec != boost::asio::error::operation_aborted when calling acceptor#is_open everywhere (like in the RPC shutdown fix), but that is probably for a different PR since is_open is called a few places.

@rkeene rkeene merged commit b97581f into nanocurrency:master Jan 28, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
functionality quality improvements This item indicates the need for or supplies a better way to implement existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants