[erlang-questions] Erlang hangs in supervisor:do_terminate/2

Lukas Larsson lukas@REDACTED
Mon Jul 13 10:11:38 CEST 2015


Hello Nico,

On Sat, Jul 11, 2015 at 2:33 PM, Nico Kruber <nico.kruber@REDACTED> wrote:

> Hi,
> I'm having trouble with supervisor:do_terminate/2 in both, Erlang 18.0.1
> and
> 18.0.2 which I haven't seen with earlier versions so far. I currently do
> not
> have a minimal use case but will try to come up with something soon.
>

Would be great if you could manage that. Minimal examples are always much
easier to work with.


> I'm using Scalaris and inside a single process, I'm starting its services
> (multiple processes in a supervisor tree) and stopping them again in a
> loop.
> Sometimes, although very rarely, stopping the services seems to hang. When
> I
> send the beam process a SIGUSR1 I can always see two processes being in
> "Running" state:
> 1) a supervisor in supervisor:do_terminate/2 (any of the present
> supervisors -
> not always the same!)
> 2) a child/worker of this supervisor handling a message (or at least, so it
> seems)
>
> Their stacktraces seem inconclusive, please find an example of the two
> processes from the crashdump_viewer below.
>

Are the stack traces always the same for the supervisor? i.e. it is Running
in do_terminate? Since there is a receive in do_terminate, if it is stuck I
would have expected it to be in the Waiting state. But if it is Running and
hanging, it could point to some kind of live lock.


> Is there any known problem/change in Erlang 18 that could have caused this?
>

There are changes in supervisor for 18 (the introduction of maps as child
specs), but it *should* not cause any problems like these.

A smaller example demonstrating what is going wrong for you would help a
lot in trying to understand what is going on.

Lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150713/e2e9ab43/attachment.htm>


More information about the erlang-questions mailing list