bitwalker / bitwalker/swarm

Unable to locate process registered via register_name/2 after hot upgrade

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

Description

I have a GenServer that I register using the `{:via, ...}` tuple. After running a hot code upgrade my process isn't discoverable anymore. I wonder if it has something to do with topology change. Maybe Swarm is trying to route it to the wrong node? But either way I think it might be a good idea to add the upgrader node to the blacklist so it doesn't cause unnecessary relocations. Or is the name too general?

```
iex(testapp@testapp-node-01.lan)4> pid = Swarm.whereis_name(:foo)
#PID<0.1304.0>
iex(testapp@testapp-node-01.lan)5> Process.alive? pid
true

22:43:11.968 [info] [swarm on testapp@testapp-node-01.lan] [tracker:nodeup] nodeup testapp_upgrader_9310@testapp-node-01.lan
22:43:11.973 [info] [swarm on testapp@testapp-node-01.lan] [tracker:topology_change] topology change complete
22:43:13.023 [info] [swarm on testapp@testapp-node-01.lan] [tracker:nodedown] nodedown testapp_upgrader_9310@testapp-node-01.lan
22:43:13.023 [info] [swarm on testapp@testapp-node-01.lan] [tracker:topology_change] topology change complete

iex(testapp@testapp-node-01.lan)7> Process.alive? pid
true
iex(testapp@testapp-node-01.lan)8> pid = Swarm.whereis_name(:foo)
:undefined
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the hot-upgrade sequence around Swarm.whereis_name(:foo), Process.alive?/2, and the nodeup, topology_change, and nodedown logs. Trace how the {:via, ...} GenServer registration is handled as the upgrader node appears and leaves; done means the process remains discoverable after the topology change.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir, erlang
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.