[BUG] EventHubConsumerClient.GetPartitionPropertiesAsync
throws InvalidOperationException
from AMQP library instead of retrying
#46525
Labels
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
Event Hubs
issue-addressed
Workflow: The Azure SDK team believes it to be addressed and ready to close.
Milestone
Library name and version
Azure.Messaging.EventHubs 5.11.5
Describe the bug
When calling method
GetPartitionPropertiesAsync
on typeEventHubConsumerClient
, exceptionInvalidOperationException
from NuGetMicrosoft.Azure.Amqp
is thrown with the following message:"Can't create session when the connection is closing"
I am pretty sure that we are not closing the
EventHubConsumerClient
or itsEventHubConnection
prematurely in our code. This claim is supported by:The fact that other concurrently called methods on the same
EventHubConsumerClient
and other clients using the sameEventHubConnection
are not throwing at the same time.Historically, there were issues in the Azure's Event Hub and Service Bus SDKs that manifested in the same way:
In both cases, the conclusion was that the thrown
InvalidOperationException
should be treated properly as an transient exception. Both issues were resolved by catching this exception in the client SDK and wrap it into retriable client exception (which would beEventHubsException
in this case). Example of such fix: https://github.com/Azure/azure-sdk-for-net/pull/15984/filesStack trace:
Expected behavior
The
InvalidOperationException
should be wrapped intoEventHubsException { IsTransient = true }
exception which should be properly retried by existing retry policies within the client SDK.Actual behavior
The
InvalidOperationException
is thrown out of the client SDK into the user code unexpectedly.Reproduction Steps
I not able to deterministically reproduce the error but it happens every few days in our stream processing service running in AKS that periodically calls the problematic
GetPartitionPropertiesAsync
as well asPartitionReceiver.ReceiveBatchAsync
(which never throws such exception).Environment
The text was updated successfully, but these errors were encountered: