Files
floci/docs/services
Suja Shaj d3c2dbb1d9 fix(ec2): skip addresses stored resources hold when the VPC network allocates (#6284)
* fix(ec2): skip addresses stored resources hold when the VPC network allocates

The VPC network's allocator reads only its lease table, but a launch that
names an address while a failed launch is still giving it back keeps the
address without a lease, and so does a network interface created with its
own address. assignPrivateIp now asks for another address while the one it
got is held by a stored instance, network interface or NAT gateway in any
account, so a later launch's Docker attach no longer fails on an address
that is already in use. The addresses it walks past are given back once it
is done, since their holders took no lease of their own.

Closes #6283

* fix(ec2): keep the fallback off addresses the VPC network walk skipped

When the walk past held addresses runs the Docker-backed allocator dry,
the synthesised fallback checked only the caller's account, so on a shared
default subnet it could hand out the address another account's resource
holds. It now skips the addresses the walk found held as well.

* test(ec2): share the mocked-network and RequestContext setup in Ec2ServiceTest

requestContexts builds the RequestContext CDI mock that four helpers and
tests each built for themselves, and mockedVpcNetworkService replaces the
mock-mode new Ec2Service(..., vpcNetworks) the private-address tests
repeated. The comment on why jakarta.enterprise.inject.Instance is written
out in full lives in requestContexts.
2026-10-22 22:33:30 -04:00
..
2026-08-21 00:09:04 -04:00