bitwalker / bitwalker/swarm

Deadlocks on bootstrapping in distributed settings

Open
#109 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
1.3k
Forks
110
PR merge metrics
No merged PRs in 30d

Description

Hi,

I'm testing the concurrency of swarm using my in-house tool (will be released soon!). I've found several deadlocks when bootstrapping swarm in distributed settings. Here is one potential sketch of how a deadlock could happen:

1. Initially `node1`, `node2` were in `cluster_wait` state
2. `node1` gets `cluster_join`, select to sync with `node2`, and enters `syncing` state
3. `node2` puts `sync` of `node1` into `pending_sync_req`
4. `node2` gets `cluster_join`, select to sync with `node1` (sync of `node1` is still in pending!), and enter `syncing` state
5. `node1` gets `sync` from `node2` and discovered a tie, it decides to wait `node2` for `sync_reply`
6. Because `node1`'s sync to `node2` is in pending, it will never get handled (and thus no `sync_reply` will be sent to `node1`)
7. Both nodes are waiting for each other. The syncing process becomes dead.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue describes a deadlock during Swarm bootstrapping in distributed settings, but names no files, tests, or entry points. Start by reproducing the node1/node2 sequence around cluster_join, sync, pending_sync_req, and sync_reply; done means the mutually waiting nodes can complete synchronization.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
distributed-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.