Skip to content

fix(#25310): revent hanging when acquiring closed channel after rabbitmq restart#25311

Merged
maliming merged 7 commits intoabpframework:devfrom
scrapstation:dev
Apr 23, 2026
Merged

fix(#25310): revent hanging when acquiring closed channel after rabbitmq restart#25311
maliming merged 7 commits intoabpframework:devfrom
scrapstation:dev

Conversation

@scrapstation
Copy link
Copy Markdown
Contributor

Resolves #25310

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an ABP RabbitMQ channel-pool deadlock scenario that can occur after a RabbitMQ restart (as described in #25310), where acquiring a previously-closed channel could block indefinitely.

Changes:

  • Moves poolItem.Acquire() to occur only after validating/replacing a closed channel.
  • Ensures a closed pooled channel is disposed/removed and potentially recreated before any exclusive “in-use” lock is taken.

@maliming maliming added this to the 10.4-preview milestone Apr 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comment thread framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/ChannelPool.cs Outdated
Comment thread framework/test/Volo.Abp.RabbitMQ.Tests/Volo/Abp/RabbitMQ/ChannelPool_Tests.cs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/ChannelPool.cs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread framework/test/Volo.Abp.RabbitMQ.Tests/Volo/Abp/RabbitMQ/ChannelPool_Tests.cs Outdated
@maliming maliming requested a review from Copilot April 23, 2026 04:59
@maliming
Copy link
Copy Markdown
Member

Hi @scrapstation, thanks for the great catch and the fix!

I pushed a few follow-ups on your branch — tightened the recovery path a bit so concurrent callers can't race into duplicate dispose/recreate, and added a small Volo.Abp.RabbitMQ.Tests project with a regression test for the hang. Hope you don't mind me piling on.

Really appreciate you digging into this one!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/ChannelPool.cs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@maliming maliming merged commit d9fc158 into abpframework:dev Apr 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BackgroundJob (RabbitMQ) hangs on EnqueueAsync after RabbitMQ service restart

3 participants