Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling signals in erl_child_setup

I have a problem with deploying Elixir/Phoenix application on Heroku. When Heroku restarts or stops the dyno, it sends SIGTERM to all user processes. Erlang starts 3 processes on application startup:

  • erl_child_setup
  • Erlang Port Mapper Deamon
  • Actual application

Sending SIGTERM to erl_child_setup results in crashing the VM and generating erl_crash.dump.

Sending SIGTERM to all processes is used quite often to ensure a graceful shutdown. While researching the crash cause I saw that people had similar issues with stopping docker containers running Erlang.

My question is: Is there a way to gracefully shutdown the VM when erl_child_setup gets SIGTERM or is there a way to instruct Heroku not to send SIGTERM to erl_child_setup?

like image 876
tkowal Avatar asked Nov 07 '22 10:11

tkowal


1 Answers

This was fixed in OTP-23.1.4, according to the reported bug, and this PR.

like image 188
2240 Avatar answered Dec 11 '22 01:12

2240