You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a web request is being processes by Cowboy, and the request handling process get sent exit signal (as in with exit/2), it seems like the process is silently crashing without reporting anything to the logger.
It looks like Cowboy handles exits of these processes here using try/catch clause:
But it does only work if process exits on it's own. When it is being sent exit signal, it's not.
This is because the process is not trapping exits, and even that wouldn't catch all signals, i.e. kill wouldn't get detected.
I have to detect these exits, and I am currently doing that by setting up a monitor.
I am just wondering if that is not something Cowboy would want to be doing internally? Since it catches exits of these processes if they exit with exit/1, maybe it makes sense to add functionality to catch abnormal exits when these processes are sent a signal with exit/2 too?
The text was updated successfully, but these errors were encountered:
I have created a PR. There's at least one issue with it (silencing crashes in tests that I don't know how to do properly). Other than that it seems to resolve the issue at least on my app.
When a web request is being processes by Cowboy, and the request handling process get sent exit signal (as in with
exit/2
), it seems like the process is silently crashing without reporting anything to the logger.It looks like Cowboy handles exits of these processes here using try/catch clause:
https://github.com/ninenines/cowboy/blob/master/src/cowboy_stream_h.erl#L289-L300
But it does only work if process exits on it's own. When it is being sent exit signal, it's not.
This is because the process is not trapping exits, and even that wouldn't catch all signals, i.e.
kill
wouldn't get detected.I have to detect these exits, and I am currently doing that by setting up a monitor.
I am just wondering if that is not something Cowboy would want to be doing internally? Since it catches exits of these processes if they exit with
exit/1
, maybe it makes sense to add functionality to catch abnormal exits when these processes are sent a signal withexit/2
too?The text was updated successfully, but these errors were encountered: