trap_exists and cowboy ws

4 views
Skip to first unread message

Roberto Ostinelli

unread,
Jul 14, 2021, 10:30:39 AMJul 14
to erlang-q...@erlang.org
All,
I'm experiencing a situation where a process spawned after a cowboy websocket handler upgrade request in init/2 has the process flag trap_exit set to true, without me doing anything to set it.

This happens in Elixir, not sure if this is related.

def websocket_init(_state) do
    Logger.info("was trapping? #{Process.flag(:trap_exit, true)}")

=> this prints "was trapping? true"

Is this expected behaviour?

Thank you,
r.

Loïc Hoguin

unread,
Jul 16, 2021, 6:11:00 AMJul 16
to Roberto Ostinelli, erlang-q...@erlang.org
Hey,

It's expected because connection processes also act as supervisors, but
there's no reason it should trap exits once the connection has switched
to Websocket. Please open a ticket or PR to make the connection switch
back to NOT trapping exits when switching to Websocket.

Cheers,
--
Loïc Hoguin
https://ninenines.eu
Reply all
Reply to author
Forward
0 new messages