hseeberger / constructr

Coordinated (etcd, ...) cluster construction for dynamic (cloud, containers) environments
Apache License 2.0
212 stars 37 forks source link

Deadlock when error during ConstructrMachine initialization #175

Closed fcecilia closed 6 years ago

fcecilia commented 6 years ago

First, this implicit ActorMaterializer look not be used. After removing it

Then that can create a deadlock if problem during ConstructrMachine initialization.

ConstructrExtension use system.systemActorOf(Constructr.props, Constructr.Name)

So it will use the System Guardian which wait for the shutdown of all "normal" actor before initiate its own shut-down. (cf https://doc.akka.io/docs/akka/current/general/supervision.html?language=scala#system-the-system-guardian)

The problem is that when we initiate an ActorMaterializer, automatically akka create a StreamSupervisor (using user guardian) and if something wrong happening during initialization of ConstructrMachine( for example a prob on the configuration), we have a deadlocking. I mean ConstructrExtension will wait for the shutdown of StreamSupervisor and but StreamSupervisor will never die.