Skip to content

BackgroundJob (RabbitMQ) hangs on EnqueueAsync after RabbitMQ service restart #25310

@scrapstation

Description

@scrapstation

Is there an existing issue for this?

  • I have searched the existing issues

Description

Description

I am using the RabbitMQ-based BackgroundJob implementation. The application starts and runs normally. However, when the RabbitMQ service is restarted during runtime, subsequent calls to _backgroundJobManager.EnqueueAsync will block and never return, causing the thread to hang.

Steps to Reproduce

  1. Configure and use RabbitMQ as the BackgroundJob provider
  2. Start the Web API application (works as expected)
  3. Restart the RabbitMQ service while the application is running
  4. Call _backgroundJobManager.EnqueueAsync(...)
  5. Observe that the call blocks indefinitely

Fix solution

Before executing poolItem.Acquire(), make sure that the Channel is not closed.

Image

Reproduction Steps

No response

Expected behavior

No response

Actual behavior

No response

Regression?

No response

Known Workarounds

No response

Version

10.1.1

User Interface

Common (Default)

Database Provider

EF Core (Default)

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

No response

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions