-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Akka.IO: fix TcpListener connection queue problem
#7623
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
Merged
Aaronontheweb
merged 14 commits into
akkadotnet:dev
from
Aaronontheweb:fix-5988-AkkaIOTcp-2
May 7, 2025
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9c843ac
Akka.IO.Tcp: cleaning up `TBD`s and API junk
Aaronontheweb 35abd6a
fixed compilation error
Aaronontheweb d62723e
made `Tcp.For` `internal`
Aaronontheweb 7bd46af
`sealed` a ton of `Tcp` classes that can't be inherited
Aaronontheweb 24e2bc3
remove pointless `DeadLetter` subscription
Aaronontheweb 03dd2a4
Akka.IO: ensure `TcpListener` doesn't do weird stuff with SAEA
Aaronontheweb d16bb31
fixed typo
Aaronontheweb df26438
Merge branch 'dev' into fix-5988-AkkaIOTcp-2
Aaronontheweb eb63f8c
tweak `Tcp` handling code
Aaronontheweb 0d445f2
Merge branch 'fix-5988-AkkaIOTcp-2' of https://github.com/Aarononthew…
Aaronontheweb 4d2913d
added updated API approvals
Aaronontheweb eb8db42
restoring ability to the `akka.io.tcp.batch-accept-limit` to be confi…
Aaronontheweb ff36133
added API approvals
Aaronontheweb 4c31bc5
added specs to validate `TcpSettings`
Aaronontheweb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a spec to validate the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| //----------------------------------------------------------------------- | ||
| // <copyright file="TcpSettingsSpec.cs" company="Akka.NET Project"> | ||
| // Copyright (C) 2009-2022 Lightbend Inc. <http://www.lightbend.com> | ||
| // Copyright (C) 2013-2025 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
| // </copyright> | ||
| //----------------------------------------------------------------------- | ||
|
|
||
| using System; | ||
| using Akka.Actor; | ||
| using Akka.Configuration; | ||
| using Akka.IO; | ||
| using FluentAssertions; | ||
| using Xunit; | ||
|
|
||
| namespace Akka.Tests.IO | ||
| { | ||
| public class TcpSettingsSpec | ||
| { | ||
| [Fact] | ||
| public void TcpSettings_should_parse_all_akka_io_tcp_config_values_correctly() | ||
| { | ||
| // Arrange: load the default reference config | ||
| var config = ConfigurationFactory.Default(); | ||
| var tcpConfig = config.GetConfig("akka.io.tcp"); | ||
| var settings = TcpSettings.Create(tcpConfig); | ||
|
|
||
| // Assert: all values match akka.conf reference | ||
| settings.BufferPoolConfigPath.Should().Be("akka.io.tcp.disabled-buffer-pool"); | ||
| settings.InitialSocketAsyncEventArgs.Should().Be(32); | ||
| settings.TraceLogging.Should().BeFalse(); | ||
| settings.BatchAcceptLimit.Should().Be(Environment.ProcessorCount * 2); | ||
| settings.RegisterTimeout.Should().Be(TimeSpan.FromSeconds(5)); | ||
| settings.ReceivedMessageSizeLimit.Should().Be(int.MaxValue); | ||
| settings.ManagementDispatcher.Should().Be("akka.actor.internal-dispatcher"); | ||
| settings.FileIODispatcher.Should().Be("akka.actor.default-blocking-io-dispatcher"); | ||
| settings.TransferToLimit.Should().Be(524288); // 512 KiB | ||
| settings.FinishConnectRetries.Should().Be(5); | ||
| settings.OutgoingSocketForceIpv4.Should().BeFalse(); | ||
| settings.WriteCommandsQueueMaxSize.Should().Be(-1); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -763,8 +763,11 @@ akka { | |
|
|
||
| # The maximum number of connection that are accepted in one go, | ||
| # higher numbers decrease latency, lower numbers increase fairness on | ||
| # the worker-dispatcher | ||
| batch-accept-limit = 10 | ||
| # the worker-dispatcher. | ||
| # | ||
| # By default we scale to logical CPUs * 2, but you can set this to an | ||
| # integer value greater than 0. | ||
| batch-accept-limit = scale-to-cpus | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Our default is going to be "scale SAEA to the CPUs" |
||
|
|
||
| # The duration a connection actor waits for a `Register` message from | ||
| # its commander before aborting the connection. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Significantly increased the default backlog to a much more reasonable
1024, which is the default in Akka.Remote.