Skip to content

[BUG] EventHubProducerClient times out on all future SendAsync requests after null reference #17792

Closed

Description

Describe the bug
In our application we use a singleton EventHubProducerClient for sending batches of EventData to an eventhub. We ran into an issue where all SendAsync calls on the instance would start to return timeout exceptions.

It turned out that this started each time after the SendAsync method was accidentally called with an empty list of EventData. Doing so results in a null-reference exceptions on that method call (which is not a major issue). It appears that this somehow breaks the underlying connection within the EventHubProducerClient, since all other calls (with valid input) to SendAsync afterwards result in a timeout.
This seems to fix itself after exactly 30 minutes, at which point all requests to SendAsync succeed again (until another call with empty list is made).

We have a fine fix for the problem in our case (just check if the list is empty before calling SendAsync), but it seems weird that all future calls to the same client also break.

Expected behavior
Calling SendAsync with an empty list does not influence future calls to the same EventHubProducerClient.

Actual behavior (include Exception or Stack Trace)
Calling EventHubProducerClient.SendAsync with an empty list of EventData results in a null-reference
image

Afterwards calling the SendAsync method on the same client results in a timeout on any request (for the next 30 minutes).
image

The issue resolves itself after 30 minutes, I suspect because the AMQP connection times out and is reset.

To Reproduce
Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)

  1. EventhubProducerClient is created (as a singleton) using connectionstring to eventhub (SAS policy)
    this.producerClient = new EventHubProducerClient(connectionString, null, null)
  2. Call SendAsync on producerClient with an empty IEnumerable (resulted in nullreference).
  3. Call SendAsync on same producerClient with a non-empty IEnumerable (resulted in Timeout).
  4. Wait 30 minutes.
  5. Call SendAsync on same producerClient with a non-empty IEnumerable (succeeds).

Environment:

  • Name and version of the Library package used: Azure.Messaging.Eventhubs (v5.2.0)
  • Hosting platform or OS and .NET runtime version (dotnet --info output for .NET Core projects): Reproduced issue both on Azure Function v3 (windows/.net) and local devmachine .NET sdk v3.1.402 and host version 3.1.8.
  • IDE and version : When running locally, Visual Studio 16.7.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Event Hubscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-author-feedbackWorkflow: More information is needed from author to address the issue.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions