ninenines / gun

HTTP/1.1, HTTP/2, Websocket client (and more) for Erlang/OTP.
ISC License
891 stars 232 forks source link

Remove explicit call to dbg:start/0 #194

Closed abxy closed 5 years ago

abxy commented 5 years ago

This fixes a bug in gun when trying to open 2 connections with tracing enabled.

You can recreate it like so:

> application:ensure_all_started(gun).
> gun:open("localhost", 80, #{trace => true}).
> gun:open("localhost", 80, #{trace => true}).

The second call fails with a cause clause exception.

You'll observe the same exception by:

> dbg:start().
> dbg:start().

Ultimately, this may be a bug in OTP, but since dbg:start/0 is undocumented I'm inclined to give it the benefit of the doubt. Regardless, since the documentation clearly states that calling dbg:tracer/0 is the proper way to start the default tracer message receiver, I argue that calling dbg:start/0 is a bug in gun.

essen commented 5 years ago

Yeah I suppose it's not necessary anymore.

essen commented 5 years ago

Merged, thanks!