Skip to content

Azure Service Bus Topics: Unexpected disconnects when using session-enabled subscriptions #4188

@thedmi

Description

@thedmi

Expected Behavior

ASB connections remain intact as long as there is no service outage or network problem.

Actual Behavior

Dapr looses the connection to ASB and reconnects later. As a consequence, pending messages in the session-enabled subscriptions are delayed for several tens of seconds up to a few minutes.

The disconnects apparently don't happen regularly or after every message.

Whenever a disconnect occurs, the following errors and warnings are logged:

2026-01-18T13:52:57.565626055Z Error reading from topic notifications. context deadline exceeded
2026-01-18T13:52:57.568850859Z context deadline exceeded
2026-01-18T13:57:37.054019159Z Failed to connect to Azure Service Bus topic notifications; will retry in 493.873304ms. Error: no sessions available
2026-01-18T13:58:05.561191484Z Successfully reconnected to Azure Service Bus topic notifications

Steps to Reproduce the Problem

The error occurs for one message in 10 in our setup, but only on session-enabled subscriptions. We have two session-enabled subscriptions, each with a dedicated pub/sub component with the following settings:

  metadata:
  - name: maxDeliveryCount
    value: 20
  - name: lockDurationInSec
    value: 30
  - name: lockRenewalInSec
    value: 13
  - name: minConnectionRecoveryInSec
    value: 1
  - name: maxConnectionRecoveryInSec
    value: 15

On the subscription, we have

metadata:
  requireSessions: "true"
  sessionIdleTimeoutInSec: "30"
  maxConcurrentSessions: "32"

It appears that the problem mainly occurs when there are a few messages that occur in batches, all with the same session ID.

Note that the session-enabled topics are usually very quiet (no messages), but when messages arrive, they arrive in batches and cover a single or a few sessions.

Release Note

RELEASE NOTE:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions