Skip to content

Exception in AzureServiceBusQueueHealthCheck #2391

@joebeernink

Description

@joebeernink

What happened:
I see a lot of these exceptions in our logs coming from the AzureServiceBusQueueHealthCheck

Azure.Messaging.ServiceBus.ServiceBusException
The operation is canceled because the owner is being closed. (ServiceTimeout). For troubleshooting information, see https://aka.ms/azsdk/net/servicebus/exceptions/troubleshoot.
ExceptionType
Azure.Messaging.ServiceBus.ServiceBusException
Assembly
Azure.Messaging.ServiceBus, Version=7.19.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8

assembly
HealthChecks.AzureServiceBus, Version=9.0.0.0, Culture=neutral, PublicKeyToken=2783471aaf72b3d9
fileName
/home/runner/work/AspNetCore.Diagnostics.HealthChecks/AspNetCore.Diagnostics.HealthChecks/src/HealthChecks.AzureServiceBus/AzureServiceBusQueueHealthCheck.cs
level
13
line
47
method
HealthChecks.AzureServiceBus.AzureServiceBusQueueHealthCheck+<>c__DisplayClass3_0+<g__CheckWithReceiver|0>d.MoveNext

What you expected to happen:

I'm not quite sure how to treat these exceptions. The app seem to be working fine, and the next health check seems to work, but we get about 120 of these a day... which is enough to trigger our alerts for exception levels. They don't seem actionable (i.e. AFAIK, there is nothing I can do to change a setting or anything to make this better.

Should there be a try-catch in the health check to handle this better with a polly-retry?

How to reproduce it (as minimally and precisely as possible):

Not sure how to repro this. Seems transient, but not sure.

Source code sample:

_ = healthChecks
    .AddCheck<AzureServiceBusQueueHealthCheck>(string.Format(AzureResources.ServiceBusQueue, queueName), tags: [Endpoints.Healthz])

Anything else we need to know?:

Not sure

Environment:

  • .NET Core version - net9.0 - 9.0.5
  • Healthchecks version: 9.0.0
  • Operative system: Linux (running a docker container on Azure Container Environment)
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions