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

Bound connection attempt concurrency in ConnectionManager #5894

Conversation

ReubenBond
Copy link
Member

This PR changes how ConnectionManager is implemented, especially in cases where there are multiple tasks waiting on a connection attempt.

  • Use a single lock for all connection management
  • Avoid the ~async spinlock and instead have waiting tasks wait on the pending connection attempt directly
  • Initiate connection task under lock, yielding immediately
  • When there are insufficient connections for an endpoint, initiate additional connections in the background and return synchronously if there is at least one valid connection already

@ReubenBond ReubenBond force-pushed the fix/networking/connection-attempt-concurrency branch from 7443de3 to 7e5ed61 Compare August 22, 2019 21:13
@ReubenBond ReubenBond force-pushed the fix/networking/connection-attempt-concurrency branch 15 times, most recently from af0b7ef to c0a3f15 Compare September 9, 2019 19:41
@ReubenBond ReubenBond force-pushed the fix/networking/connection-attempt-concurrency branch 2 times, most recently from 82018d8 to 85dca00 Compare September 13, 2019 17:33
@ReubenBond ReubenBond force-pushed the fix/networking/connection-attempt-concurrency branch from 85dca00 to 02be6c0 Compare September 13, 2019 17:48
message,
CancellationToken.None,
TaskCreationOptions.DenyChildAttach,
TaskScheduler.Default);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we .Ignore() this task?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add that or make sure the task cannot throw

@sergeybykov sergeybykov merged commit f5b44c5 into dotnet:master Sep 24, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Dec 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants