Skip to content

Azure EventHub pubsub - Excessive publish duration after inactivity #4363

Description

@foliv57

Symptom

We are using "pubsub.azure.eventhubs" component to publish events to an Azure EventHub from an ASP.NET web application.

After cold start of the containers, the duration of the first publish event is acceptable (1s to 3s). But after a period of inactivity (between 1 and 2 hours), the first publish event takes 15s.

Below the Dapr container log that we see after inactivity:

time="2026-04-29T06:07:46.720941374Z" level=info msg="gRPC API Called" app_id=`XXXXXX-dapr code=0 duration=14801 instance=XXXXXXX--r1-2-1-alpha-0-115-7c457b6544-z9qbp method=/dapr.proto.runtime.v1.Dapr/PublishEvent scope=dapr.runtime.grpc.api-info type=log useragent="grpc-dotnet/2.76.0 (.NET 10.0.7; CLR 10.0.7; net10.0; linux; x64) dapr-sdk-dotnet/v1.17.4+896bff16f9e29feb7a9bd9749a38640103d3b352" ver=1.16.4-msft.2

What we already tried:

  • Replace managed identity by connection string to prevent token aquisition latency
  • Setup min replica to 1 to keep always 1 container app replica
  • Ensured that the DaprClient is injected as Singleton

Environement

  • Component type: pubsub.azure.eventhubs
  • Client SDK: Dotnet Dapr.Client 1.17.0
  • App framework: .NET 10
  • Hosting: Azure Container App
  • Dapr version: 1.16.4-msft.2

Expected Behavior

First publish after inactivity should not take longer than after cold start and be reasonable (~1s to 3s)

Actual Behavior

First publish after inactivity takes more than 15s.

Steps to Reproduce the Problem

  • Deploy an Azure Container App that uses a "pubsub.azure.eventhubs" component to publish events to an Azure EventHub.
  • Make a first cold start publish (Should be fast)
  • Wait for 1 or 2 hours with no activity
  • Make a second publish (Should take more than 10s)

Release Note

RELEASE NOTE: FIX Azure EventHub pubsub - Excessive publish duration after inactivity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions