Skip to content

Conversation

@sasa1977
Copy link
Contributor

This PR fixes a bug which happens if a process started with name: {:via, Registry, {registry_name, process_name, value}} crashes during the startup. In this case, instead of the original error, a no function clause exception happens in the Registry module. Minimal example:

iex> Registry.start_link(keys: :unique, name: Foo)
iex> Agent.start_link(fn -> raise "foo" end, name: {:via, Registry, {Foo, :name, :value}})

** (EXIT from #PID<0.105.0>) shell process exited with reason: an exception was raised:
    ** (FunctionClauseError) no function clause matching in Registry.unregister_name/1
        (elixir 1.10.2) lib/registry.ex:264: Registry.unregister_name({Foo, :name, :value})

@josevalim josevalim merged commit e7555da into elixir-lang:master Sep 13, 2020
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@sasa1977 sasa1977 deleted the fix-unregistration-exception branch October 18, 2020 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants