mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 14:30:28 -05:00
The certificate check on ModifyListener runs twice: once outside IAM's certificate lock, where it keeps the error precedence AWS has, and once under the lock, where it is atomic with the write. The second one sat behind the port, protocol and SSL policy setters, so a DeleteServerCertificate landing between the two answered CertificateNotFound on a listener that had already moved to its new port. The comment above the first check says no refusal leaves the listener changed, which only held for the check it sits on. Every setter now runs inside the guard, behind the re-check, so a refusal either lands before anything is written or does not land at all. The guard is still taken for the certificates the request records, which are the only ones a delete can race: one the listener already holds is a reference DeleteServerCertificate finds, and it refuses to delete it. The re-check covers the effective list, which is what a protocol flip putting the stored certificates into service needs, so that path is checked under the lock too rather than once on the way in. The restartDataPlane local is gone, because a lambda cannot assign a local and portChanges already says the same thing at the one place it was read. Two unit tests, both of which fail without the change: a refused modify leaves the port, protocol, policy and certificates alone and does not restart the data plane, and a protocol flip refused the same way leaves the protocol alone. The resolver they wire finds the certificate once and not again, which is what a delete landing between the two checks looks like from inside the call. docs/services/elb.md records the guarantee next to the lock it comes from. Follow-up to the review note on #5474.