elixir-plug / plug_cowboy

Plug adapter for the Cowboy web server
Other
243 stars 48 forks source link

OTP 24 and Elixir 1.13 compatibility #83

Closed carrascoacd closed 2 years ago

carrascoacd commented 2 years ago

Context

This library depends on cowboy ~> 2.7 which is using the deprecated :erlang.get_stacktrace/0. It happens that when an unexpected error raises, we could end up with this situation:

 Ranch protocol #PID<0.10445.0> of listener Wharever.Endpoint.HTTP (connection #PID<0.10444.0>, stream id 1) terminated
an exception was raised:
    ** (UndefinedFunctionError) function :erlang.get_stacktrace/0 is undefined or private
        :erlang.get_stacktrace()
        (cowboy 2.7.0) /builds/whatever/deps/cowboy/src/cowboy_stream_h.erl:314: :cowboy_stream_h.request_process/3
        (stdlib 3.17.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

We are in front of an outdated dependency that prevents us from using Phoenix with OTP 24, for example.

Proposed solution

I think it's time to upgrade this library, so:

Let me know if it makes sense and I'll submit a PR with the changes.

josevalim commented 2 years ago

This library provides a minimum version. Which means you should be able to use it with more recent Elixir, OTP and Cowboy versions without any problems. So I don't believe any action is required, you simply need to run mix deps.update cowboy in your app! Thank you.