Skip to content

Fix stream SAC coordinator deadlock when deactivating consumer disconnects (backport #15353)#15364

Merged
acogoluegnes merged 1 commit intov4.2.xfrom
mergify/bp/v4.2.x/pr-15353
Jan 28, 2026
Merged

Fix stream SAC coordinator deadlock when deactivating consumer disconnects (backport #15353)#15364
acogoluegnes merged 1 commit intov4.2.xfrom
mergify/bp/v4.2.x/pr-15353

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify bot commented Jan 28, 2026

When a consumer in {connected, deactivating} state had its node
disconnect, it would transition to {disconnected, deactivating}.
This state blocked rebalancing because is_active/1 returned true,
leaving the group with no active consumer indefinitely.

Changes:

  • handle_group_after_connection_node_disconnected now transitions
    {connected, deactivating} to {disconnected, waiting} and triggers
    rebalancing, since the deactivation handshake cannot complete
  • handle_group_connection_presumed_down applies the same fix as
    defense in depth for {disconnected, deactivating} consumers
  • handle_connection_node_disconnected updated to accumulate effects
    from group processing
  • bump stream coordinator machine version to 6 and handle backward
    compatibility

Added test cases covering:

  • Node disconnect during deactivation (simple and super streams)
  • Connection down during deactivation
  • Multiple consumers from same connection with one deactivating
  • Reconnection after disconnect during deactivation
  • Presume down with deactivating consumer (simple and super streams)

References rabbitmq/rabbitmq-stream-dotnet-client#447


This is an automatic backport of pull request #15353 done by Mergify.

…nects

When a consumer in {connected, deactivating} state had its node
disconnect, it would transition to {disconnected, deactivating}.
This state blocked rebalancing because is_active/1 returned true,
leaving the group with no active consumer indefinitely.

Changes:
- handle_group_after_connection_node_disconnected now transitions
  {connected, deactivating} to {disconnected, waiting} and triggers
  rebalancing, since the deactivation handshake cannot complete
- handle_group_connection_presumed_down applies the same fix as
  defense in depth for {disconnected, deactivating} consumers
- handle_connection_node_disconnected updated to accumulate effects
  from group processing
- bump stream coordinator machine version to 6 and handle backward
  compatibility

Added test cases covering:
- Node disconnect during deactivation (simple and super streams)
- Connection down during deactivation
- Multiple consumers from same connection with one deactivating
- Reconnection after disconnect during deactivation
- Presume down with deactivating consumer (simple and super streams)

References rabbitmq/rabbitmq-stream-dotnet-client#447

(cherry picked from commit cd87226)
@acogoluegnes acogoluegnes added this to the 4.2.4 milestone Jan 28, 2026
@acogoluegnes acogoluegnes merged commit c2d8ad2 into v4.2.x Jan 28, 2026
576 of 577 checks passed
@acogoluegnes acogoluegnes deleted the mergify/bp/v4.2.x/pr-15353 branch January 28, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant