Skip to content

Deadlock when both sides send ResendRequest simultaneously #312

@davidsteiner

Description

@davidsteiner

When both sides detect a sequence number gap at the same time, they each send a ResendRequest. However, in AwaitingResend state, all messages with a sequence number above end_seq_number are unconditionally queued (session.rs, process_message). This means each side queues the other's ResendRequest instead of processing it, and neither side ever starts resending — creating a deadlock.

The fix is to exempt ResendRequest (type "2") and SequenceReset (type "4") from being queued, since they are part of the gap recovery mechanism itself and must always be processed immediately.

Metadata

Metadata

Assignees

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