Skip to content

Fix requeue pending message deadlock#290

Merged
meling merged 1 commit intomasterfrom
meling/289/requeue-self-deadlock
Mar 14, 2026
Merged

Fix requeue pending message deadlock#290
meling merged 1 commit intomasterfrom
meling/289/requeue-self-deadlock

Conversation

@meling
Copy link
Member

@meling meling commented Mar 14, 2026

Fixes #289

@deepsource-io
Copy link
Contributor

deepsource-io bot commented Mar 14, 2026

DeepSource Code Review

We reviewed changes in da14cbe...1a8d57f on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Go Mar 14, 2026 4:44p.m. Review ↗
Shell Mar 14, 2026 4:44p.m. Review ↗

Copy link
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

Fixes a deadlock in internal/stream.Channel when requeuePendingMsgs is invoked from sender() after a failed stream.Send while sendQ is unbuffered (default), by avoiding a self-blocking enqueue on the same queue the sender is responsible for draining.

Changes:

  • Prevents sender() from deadlocking itself by performing the requeue-enqueue loop asynchronously.
  • Preserves existing behavior of cancelling streaming (non-retriable) pending requests with ErrStreamDown.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@meling meling merged commit a0171d5 into master Mar 14, 2026
9 checks passed
@meling meling deleted the meling/289/requeue-self-deadlock branch March 14, 2026 17:03
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.

bug: requeuePendingMsgs Deadlock and Local Dispatch Contention

2 participants