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

Better handling of TCP accept overflow #1638

Merged
merged 3 commits into from Jan 28, 2019

Conversation

Projects
2 participants
@rkeene
Copy link
Contributor

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.

Better handling of TCP accept overflow
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 self-assigned this Jan 25, 2019

@rkeene rkeene added this to the V18.0 milestone Jan 25, 2019

@zhyatt zhyatt requested a review from cryptocode Jan 25, 2019

@zhyatt zhyatt added this to CP 3 (2018-01-23) in V18 Jan 25, 2019

@cryptocode

This comment has been minimized.

Copy link
Collaborator

commented Jan 26, 2019

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

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.