hedwig-im / hedwig

An Adapter-based Bot Framework for Elixir Applications
MIT License
650 stars 73 forks source link

Double supervision #60

Open michalmuskala opened 7 years ago

michalmuskala commented 7 years ago

There exists a subtle issue with Hedwig robot's because of how they are started.

The start_link function will start the robot under hedwig's supervisor. At the same time it's recommended to put the robot in the user's supervision tree. This causes the robot process to be supervised by two supervisors, which can lead to errors during code upgrade. There are no errors when the robot is restarted, only because it's running as a transient process under the hedwig supervisor.

The appropriate fix would be to not attach the process under the hedwig supervisor and leave the supervision to the user's application.

scrogson commented 7 years ago

Hey @michalmuskala, thanks for catching that. I'll work on fixing it.