archethic-foundation / archethic-foundation/archethic-node

ConnectionSupervisor does not handle restart properly

Open
#1,419 0 comments 0 reactions 0 assignees View on GitHub
bug P2P
Dominant language
Elixir
Stars
82
Forks
24
PR merge metrics
No merged PRs in 30d

Description

### Describe the problem you discovered

We had an issue where the module Connection was being terminated very quickly due to an issue with libsodium.
This resulted in a "reached max restart intensity" of the ConnectionSupervisor.
The ConnectionSupervisor was restarted with an empty state, which means no Connection.

![Capture d’écran 2024-02-06 à 10 14 33](https://github.com/archethic-foundation/archethic-node/assets/74045243/57087ce1-e0f5-44f2-9644-e785307c556c)
(screenshot of the network view of the incriminating node)

I used `Archethic.P2P.connect_nodes(Archethic.P2P.MemTable.available_nodes)` to restart the connections.

### Describe the solution you'd like

Somehow, if the ConnectionSupervisor is restarted, we need to reconnect to the nodes

### Epic

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at ConnectionSupervisor and Archethic.P2P.connect_nodes/1, using Archethic.P2P.MemTable.available_nodes as the node source. Trace or reproduce the supervisor-restart scenario and inspect how connections are restored. Done means a restart no longer leaves the supervisor with an empty connection state, with a regression test covering the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.