Summary
The uAMQP Event Hubs transport does not recover when a CBS PutToken operation returns a non-OK result. A synchronous send or receive can also return an exact amqp:unauthorized-access result after the connection authorization state becomes stale.
The failed public call can succeed after the client replaces the complete AMQP stack and authenticates on a fresh connection.
Motivation
A fresh connection can repair stale or damaged CBS state without making authorization failures globally transient. The recovery must remain bounded and must not retry credential rejection or asynchronous link failures.
Proposal
Allow one additional authentication attempt on a fresh connection per public producer or receiver call in the uAMQP transport.
- Leave the Rust AMQP transport unchanged.
- Honor
RetryOptions.MaxRetries == 0; this value disables authentication recovery.
- Track the authentication recovery separately from ordinary transient retries and share it across nested phases of one public call.
- Recover only a non-OK CBS
PutToken result or an exact synchronous amqp:unauthorized-access send or receive result.
- Do not recover credential
GetToken failures, asynchronous link or attach authorization failures, or CBS open Invalid and Cancelled results.
- Apply the ordinary retry budget to a CBS open
Error result and other transient failures that occur before CBS returns an authentication result.
- Replace the complete producer or receiver stack before the authentication attempt.
- Preserve the consumer-created
PartitionClient handle and resume exclusively after the last delivered offset.
- Use the configured first-retry delay with the existing 0.8 to 1.3 jitter and
MaxRetryDelay cap.
RetryOptions.RetryDelay defaults to 800 ms. The default first-retry range is 640 to 1,040 ms.
- Use an
Azure::Core::Context-aware wait.
- Stop after the second authentication failure and preserve the final public exception type and details.
- Preserve generation and in-flight safety during concurrent teardown.
This change requires explicit security-focused review.
Validation
Summary
The uAMQP Event Hubs transport does not recover when a CBS
PutTokenoperation returns a non-OK result. A synchronous send or receive can also return an exactamqp:unauthorized-accessresult after the connection authorization state becomes stale.The failed public call can succeed after the client replaces the complete AMQP stack and authenticates on a fresh connection.
Motivation
A fresh connection can repair stale or damaged CBS state without making authorization failures globally transient. The recovery must remain bounded and must not retry credential rejection or asynchronous link failures.
Proposal
Allow one additional authentication attempt on a fresh connection per public producer or receiver call in the uAMQP transport.
RetryOptions.MaxRetries == 0; this value disables authentication recovery.PutTokenresult or an exact synchronousamqp:unauthorized-accesssend or receive result.GetTokenfailures, asynchronous link or attach authorization failures, or CBS openInvalidandCancelledresults.Errorresult and other transient failures that occur before CBS returns an authentication result.PartitionClienthandle and resume exclusively after the last delivered offset.MaxRetryDelaycap.RetryOptions.RetryDelaydefaults to 800 ms. The default first-retry range is 640 to 1,040 ms.Azure::Core::Context-aware wait.This change requires explicit security-focused review.
Validation
PutTokenrebuilds once and succeeds within the same call.PutTokenrebuilds once and resumes from the correct position.amqp:unauthorized-accesstransfer rebuilds once.RetryOptions.MaxRetries == 0causes no additional authentication attempt.GetTokenfailure causes no additional authentication attempt.