Skip to content

AOT (6/7): remove UDP buffer pooling, keep the DNS provider configurable through a built-in table - #8606

Merged
Aaronontheweb merged 1 commit into
aot/m1-e-routers-guardian-dispatchersfrom
aot/io-dns-and-buffer-pool-not-configurable
Sep 25, 2026
Merged

Aaronontheweb merged 1 commit into
aot/m1-e-routers-guardian-dispatchersfrom
aot/io-dns-and-buffer-pool-not-configurable

Conversation

@Aaronontheweb

@Aaronontheweb Aaronontheweb commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Changes

Removes two HOCON type-name hooks from Akka.IO, and keeps the one that is a real extension point.

UDP buffer pools: removed. DirectBufferPool was internal, off by default, and never asked for.

  • UdpExt and UdpConnectedExt always construct DisabledBufferPool, reading only disabled-buffer-pool.buffer-size.
  • Deleted: DirectBufferPool, the CreateBufferPool reflection helper in both extensions, and the buffer-pool / class / direct-buffer-pool config for udp and udp-connected.
  • The public IBufferPool, BufferPoolInfo and BufferPoolAllocationException stay, now in IBufferPool.cs.
  • UdpSettings.BufferPoolConfigPath is marked [Obsolete], matching TcpSettings.BufferPoolConfigPath.
  • The dead akka.io.tcp buffer-pool config goes too (TcpExt never read it), along with the test-adapter and perf-spec lines that set it.

DNS provider: stays configurable, through the standard built-in table.

  • provider-object keeps its meaning. InetAddressDnsProvider comes from a BuiltInDnsProviders table.
  • Any other name loads by reflection while Akka.DynamicTypeLoading is on, and throws ConfigurationException (AkkaFeatures.NotBuiltIn) while it's off.
  • The built-in provider's SimpleDnsManager and InetAddressDnsResolver are built with typed constructors. A custom provider keeps the Props.Create(Type, ...) path, which is [RequiresUnreferencedCode] and guarded so the trimmer drops it when the switch is off.
  • A rooted Akka.AOT.App publish loses the five targeted IO/* trim warnings, and nothing else regresses.

Tests

  • DnsProviderConfigSpec: DNS resolves end to end with the switch off; the built-in name's spellings resolve; a custom provider loads with the switch on and throws with it off.
  • UdpDisabledBufferPoolSpec: the configured buffer-size is read.
  • The UDP integration specs drop their direct-pool config. Three leak tests are removed; they could never fail, since DisabledBufferPool reports zero usage.

Ledger: two rows. The UDP row includes the migration step: move a custom buffer-size to disabled-buffer-pool.buffer-size, or datagrams larger than 512 bytes are cut off.

Also updates the coordinated-shutdown.md snippet range, which points into akka.conf.

Stack: PR 6 of 7 for AOT milestone 1. It isn't on the local boot path. Design and measurements: epic #7246.

Checklist

@Aaronontheweb Aaronontheweb added the AOT Ahead-of-Time (AOT) Compilation label Sep 23, 2026
@Aaronontheweb
Aaronontheweb added this pull request to stack #8607 September 23, 2026 02:07
@Aaronontheweb Aaronontheweb added this to the 1.6.0 milestone Sep 23, 2026
@Aaronontheweb
Aaronontheweb deleted the aot/io-dns-and-buffer-pool-not-configurable branch September 23, 2026 02:24
@Aaronontheweb
Aaronontheweb restored the aot/io-dns-and-buffer-pool-not-configurable branch September 23, 2026 02:42
@Aaronontheweb Aaronontheweb reopened this Sep 23, 2026
@Aaronontheweb
Aaronontheweb force-pushed the aot/io-dns-and-buffer-pool-not-configurable branch from 51b73ef to 225875c Compare September 23, 2026 02:46
@Aaronontheweb
Aaronontheweb force-pushed the aot/io-dns-and-buffer-pool-not-configurable branch from 225875c to b3b0bc4 Compare September 23, 2026 14:19
@Aaronontheweb

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@Aaronontheweb
Aaronontheweb force-pushed the aot/io-dns-and-buffer-pool-not-configurable branch from b3b0bc4 to b375cdd Compare September 23, 2026 14:47
@Aaronontheweb
Aaronontheweb force-pushed the aot/io-dns-and-buffer-pool-not-configurable branch from b375cdd to b871cf3 Compare September 23, 2026 18:09
@Aaronontheweb
Aaronontheweb force-pushed the aot/io-dns-and-buffer-pool-not-configurable branch 3 times, most recently from 00b0f52 to 27bf822 Compare September 24, 2026 03:31
@Aaronontheweb
Aaronontheweb force-pushed the aot/io-dns-and-buffer-pool-not-configurable branch from 27bf822 to fcd701c Compare September 24, 2026 13:58
@Aaronontheweb
Aaronontheweb force-pushed the aot/io-dns-and-buffer-pool-not-configurable branch from fcd701c to 212e2a0 Compare September 24, 2026 15:26

@Aaronontheweb Aaronontheweb left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not quite there - we don't want to make buffer pools configurable at all for Akka.IO. That's an over-engineered feature we don't need to keep supporting.

@Aaronontheweb
Aaronontheweb removed this pull request from stack #8607 September 24, 2026 16:42
@Aaronontheweb
Aaronontheweb changed the base branch from feature/aot-m1-e-routers-guardian-dispatchers to aot/m1-e-routers-guardian-dispatchers September 24, 2026 16:42
@Aaronontheweb
Aaronontheweb added this pull request to stack #8632 September 24, 2026 16:43
@Aaronontheweb
Aaronontheweb force-pushed the aot/io-dns-and-buffer-pool-not-configurable branch from 212e2a0 to 81e5d26 Compare September 24, 2026 16:44
@Aaronontheweb
Aaronontheweb force-pushed the aot/io-dns-and-buffer-pool-not-configurable branch from 81e5d26 to 7e92eaa Compare September 24, 2026 17:00
@Aaronontheweb Aaronontheweb changed the title AOT (6/7): stop loading the Akka.IO DNS provider and the UDP buffer pools from HOCON type names AOT (6/7): remove UDP buffer pooling, keep the DNS provider configurable through a built-in table Sep 24, 2026
…rough a built-in table

The first version of this change tried to keep two reflection-driven hooks alive under a
feature switch. Neither one earned that: one had never had a second implementation, and the
other had no live callers at all. This redoes both from scratch.

UDP buffer pools. DirectBufferPool pooled byte buffers; DisabledBufferPool allocated a fresh
one every time. disabled-buffer-pool was the shipped default, and nothing here or in a
support ticket ever asked for the other one. UdpExt and UdpConnectedExt now construct
DisabledBufferPool directly from each extension's own disabled-buffer-pool section, reading
only its buffer-size key. DirectBufferPool is deleted outright, along with buffer-pool, class
and the direct-buffer-pool sections in akka.conf, and the duplicated CreateBufferPool
reflection helper. IBufferPool, BufferPoolInfo and BufferPoolAllocationException are
untouched (moved into a renamed IBufferPool.cs), so the API approval baselines do not move.
Pooling cannot be re-enabled: anyone who pointed buffer-pool at direct-buffer-pool with a
larger buffer-size must move that value to disabled-buffer-pool.buffer-size, or datagrams
over the new default of 512 bytes get truncated on receive -- called out in the ledger.

akka.io.tcp.buffer-pool / direct-buffer-pool / disabled-buffer-pool are also gone from
akka.conf. TcpExt never read them -- TcpSettings.BufferPoolConfigPath has carried
[Obsolete("This property is unused")] since before this change. Both MultiNodeTestCaseRunner
adapters set akka.io.tcp.buffer-pool to disabled-buffer-pool and pointed its buffer-size at
TcpBufferSize; that configured nothing and is deleted. TcpHorizontalScaleSpec had the same
dead block. TcpBufferSize itself stays: TcpLoggingServer uses it as a segment-size heuristic
unrelated to Akka.IO's buffer pools.

DNS provider. provider-object is a real extension point, so it stays configurable in both
feature-switch states, matching how PRs A-E treat every other built-in-but-overridable HOCON
type name. DnsExt resolves it through a BuiltInDnsProviders table before falling back to
Type.GetType + Activator.CreateInstance, which now only runs while Akka.DynamicTypeLoading is
on and lives behind [RequiresUnreferencedCode]. With the switch off, a provider-object that
isn't the built-in provider throws ConfigurationException via AkkaFeatures.NotBuiltIn instead
of being silently ignored with a warning.

DnsExt.Manager builds SimpleDnsManager with a typed Props.Create lambda, and SimpleDnsManager
builds InetAddressDnsResolver the same way, instead of Props.Create(Type, args) off
IDnsProvider.ManagerClass/ActorClass. A custom provider keeps the reflection path in both
places behind its own [RequiresUnreferencedCode] helper. The guard at each call site checks
Provider.GetType() == typeof(InetAddressDnsProvider) rather than an `is` check, since a
subclass could re-implement IDnsProvider, with the switch checked first so it still folds
under trimming. Confirmed with a rooted Akka.AOT.App publish: the five IO/* trim warnings
this removes (two Type.GetType sites for the buffer pools, one for the provider, two
Props.Create(Type, ...) sites for its manager and resolver) stay at zero.

Tests: DnsProviderConfigSpec (default config resolves DNS end to end with the switch off;
every accepted spelling of the built-in provider name resolves with the switch off; a custom
provider loads and resolves end to end with the switch on; a custom provider throws
ConfigurationException with the switch off) and UdpDisabledBufferPoolSpec, which checks the
configured buffer-size is actually used rather than round-tripping a packet. Dropped three
tautological "must not leak memory" tests against DisabledBufferPool, whose Diagnostics()
always returns 0/0/0 and so could never fail.

Ledger: two BREAKING_CHANGES_V1.6.md entries -- UDP pooling removed outright (Behavior, not
Behavior + API, since DirectBufferPool was internal), with the buffer-size migration note; DNS
provider resolution gated on the feature switch rather than downgraded to a warning.
@Aaronontheweb
Aaronontheweb force-pushed the aot/io-dns-and-buffer-pool-not-configurable branch from 7e92eaa to 6c089a7 Compare September 25, 2026 00:46
@Aaronontheweb
Aaronontheweb merged commit ebb0c78 into dev Sep 25, 2026
16 checks passed
@Aaronontheweb
Aaronontheweb deleted the aot/io-dns-and-buffer-pool-not-configurable branch September 25, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AOT Ahead-of-Time (AOT) Compilation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant