shoehorn
shoehorn copied to clipboard
Shoehorn.Handler behaviour not working with Elixir 1.16.3 / OTP 26.2.5
Environment
- Elixir version (
elixir -v
): 1.16.3 OTP 26.2.5 - Additional information about your host, target hardware or environment that may help I am running the steps in the example provided at: https://github.com/nerves-project/shoehorn/tree/c7d1caa0cc6020c7251c9fc4da3de876b535c0b2/example
Current behavior
Shoehorn behaviour does not seem to be getting used at all.
Steps to reproduce
- First, comment on the "raise" statement in crash_app/lib/crash_app/application.ex (documentation should probably say to do this, as your example does not work as expected without it)
- Follow steps in example README
cd my_project
mix deps.get
mix release
RELEASE_BOOT_SCRIPT=shoehorn _build/dev/rel/my_project/bin/my_project start_iex
- Run Application.stop :my_project
Expected behavior
Application should restart, and we should see Logger.info print messages
Actual Behaviour
Application exits, and does not restart. Also, there are no Logger.info prints at all, even if the prints in my_project/lib/my_project/shoehorn_handler.ex are switched to IO.puts/1, which shows the code is not being called at all I think.
pokyuser@docker:/workdir/shoehorn/example/my_project$ RELEASE_BOOT_SCRIPT=shoehorn _build/dev/rel/my_project/bin/my_project start_iex
10:59:59.207 [info] System initialization application started!
Erlang/OTP 26 [erts-14.2.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]
Interactive Elixir (1.16.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(my_project@docker)1> Application.stop :my_project
11:00:08.784 [notice] Application my_project exited: :stopped
:ok
iex(my_project@docker)2>
nil
iex(my_project@docker)3>
nil
iex(my_project@docker)4> Application.stop :my_project
{:error, {:not_started, :my_project}}
iex(my_project@docker)5> Application.stop :my_project
{:error, {:not_started, :my_project}}
iex(my_project@docker)6> Application.stop :my_project
{:error, {:not_started, :my_project}}
iex(my_project@docker)7> Application.stop :my_project
{:error, {:not_started, :my_project}}
iex(my_project@docker)8> Application.stop :my_project
{:error, {:not_started, :my_project}}
iex(my_project@docker)9> Application.stop :my_project
{:error, {:not_started, :my_project}}
iex(my_project@docker)10>