Summary
AMQPLinks.Retry can lose the connection revision associated with a recovery setup error. Link setup can advance links.id.Conn before session or link creation fails, while lastID still identifies the earlier connection.
Motivation
Exhausted cleanup can treat the failed revision as a concurrent successful recovery and leave the failed connection cached. A later retry can start with a zero ID and skip recovery of that revision, which can leave a sender or receiver unusable. This state predates pull request #27450.
Proposal
Capture the exact link and connection ID associated with a recovery setup error while links.mu is held. Use the existing link ID and namespace connection revision checks during cleanup so a later successful recovery remains open. Add a regression test that fails setup after links.id.Conn advances and verifies that the failed revision is cleaned.
Found while reviewing #27450.
Summary
AMQPLinks.Retrycan lose the connection revision associated with a recovery setup error. Link setup can advancelinks.id.Connbefore session or link creation fails, whilelastIDstill identifies the earlier connection.Motivation
Exhausted cleanup can treat the failed revision as a concurrent successful recovery and leave the failed connection cached. A later retry can start with a zero ID and skip recovery of that revision, which can leave a sender or receiver unusable. This state predates pull request #27450.
Proposal
Capture the exact link and connection ID associated with a recovery setup error while
links.muis held. Use the existing link ID and namespace connection revision checks during cleanup so a later successful recovery remains open. Add a regression test that fails setup afterlinks.id.Connadvances and verifies that the failed revision is cleaned.Found while reviewing #27450.