# Singleton - global, supervised singleton processes for Elixir

**URL:** <https://forum.elixirforum.com/t/singleton-global-supervised-singleton-processes-for-elixir/2175>\
**Category:** Announcing\
**Tags:** library, singleton\
**Created:** [October 30, 2016, 4:50am UTC](https://forum.elixirforum.com/t/singleton-global-supervised-singleton-processes-for-elixir/2175 "2016-10-30T04:50:25Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![bodgix](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bodgix/32/9879_2.png) [@bodgix](https://forum.elixirforum.com/u/bodgix)\
**Post date:** [February 12, 2022, 10:38pm UTC](https://forum.elixirforum.com/t/singleton-global-supervised-singleton-processes-for-elixir/2175/3 "2022-02-12T22:38:09Z")

</div>

Hi.  
Thanks for putting the library together.

Before I found it, I’ve been trying to hack my own implementation and I ended up with a very similar code as yours.

However, both your code and mine suffers from an unexpected behavior.

When a 2nd node joins the cluster, I do see:

```elixir
23:24:54.246 [info] global: Name conflict terminating {:singleton, #PID<18487.303.0>}

```

But what is unexpected is that not only the singleton process is terminated, but the whole application on one of the nodes:

```elixir
23:25:47.517 [info] Application wpc5_singleton exited: killed

```

And one of the nodes basically is left in a state where my own application is not running, only the “libraries” continue running.

I’ve been struggling with the same issue in my own implementation.

I created a DynamicSupervisor for the singleton process, similarly to you and I was hoping that it will “shield” the main Application supervisor from crashing when the :global registry kills one of the singleton processes.

However, that doesn’t seem to be the case and the whole application dies regardless of multiple layers of supervisors ☹

Using Elixir version 1.12.3

---

_[View the full topic](https://forum.elixirforum.com/t/singleton-global-supervised-singleton-processes-for-elixir/2175)._
