diff options
author | Loïc Hoguin <[email protected]> | 2025-02-08 14:53:54 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2025-02-08 14:53:54 +0100 |
commit | fbd680f0f6fb5fe99c4345b838cb42aa1afb3283 (patch) | |
tree | 470912c6388453720f41afff413177cc3aecf5c7 /src | |
parent | cc97c770fbe6484b56e661021c4350163349a740 (diff) | |
download | cowboy-fbd680f0f6fb5fe99c4345b838cb42aa1afb3283.tar.gz cowboy-fbd680f0f6fb5fe99c4345b838cb42aa1afb3283.tar.bz2 cowboy-fbd680f0f6fb5fe99c4345b838cb42aa1afb3283.zip |
Properly handle external exits of request processes
Because the exit reason doesn't include the stacktrace they
were ignored. Now they are properly handled. The error message
was changed slightly to accomodate.
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy_stream_h.erl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cowboy_stream_h.erl b/src/cowboy_stream_h.erl index b373344..e384eb0 100644 --- a/src/cowboy_stream_h.erl +++ b/src/cowboy_stream_h.erl @@ -138,7 +138,7 @@ info(StreamID, Info={'EXIT', Pid, {{request_error, Reason, _HumanReadable}, _}}, {error_response, Status, #{<<"content-length">> => <<"0">>}, <<>>}, stop ], State); -info(StreamID, Exit={'EXIT', Pid, {Reason, Stacktrace}}, State=#state{ref=Ref, pid=Pid}) -> +info(StreamID, Exit={'EXIT', Pid, Reason}, State=#state{ref=Ref, pid=Pid}) -> Commands0 = [{internal_error, Exit, 'Stream process crashed.'}], Commands = case Reason of normal -> Commands0; @@ -146,9 +146,8 @@ info(StreamID, Exit={'EXIT', Pid, {Reason, Stacktrace}}, State=#state{ref=Ref, p {shutdown, _} -> Commands0; _ -> [{log, error, "Ranch listener ~p, connection process ~p, stream ~p " - "had its request process ~p exit with reason " - "~999999p and stacktrace ~999999p~n", - [Ref, self(), StreamID, Pid, Reason, Stacktrace]} + "had its request process ~p exit with reason ~0p~n", + [Ref, self(), StreamID, Pid, Reason]} |Commands0] end, %% @todo We are trying to send a 500 response before resetting |