lexmag / statix

Fast and reliable Elixir client for StatsD-compatible servers
https://hexdocs.pm/statix
ISC License
275 stars 82 forks source link

Broken in Erlang 26 (Port.command / :port_command) #69

Open lucas-nelson opened 1 year ago

lucas-nelson commented 1 year ago

Running in Elixir 1.14.5 and Erlang 26.0, I was experiencing the call to increment hanging, and then other calls in other processes erroring with lost value 1 due to port closure.

Trying to work out what was going on, I got down to:

iex(1)> init_conn = Statix.Conn.new(System.get_env("STATSD_HOST"), String.to_integer(System.get_env("STATSD_PORT")))
%Statix.Conn{sock: nil, header: [1, 31, 189, 172, 16, 138, 8, 0, 0, 0, 0]}
iex(2)> open_conn = Statix.Conn.open(init_conn)
%Statix.Conn{
  sock: #Port<0.27>,
  header: [1, 31, 189, 172, 16, 138, 8, 0, 0, 0, 0]
}
iex(3)> Statix.Conn.transmit(open_conn, :counter, "counter.testing", "1", [])
** (EXIT from #PID<0.857.0>) shell process exited with reason: :einval

This seems related to https://github.com/erlang/otp/issues/7130 which won't be fixed.

After downgrading to Erlang 25, that sequence above works with an :ok result.

Is this project still maintained? Could the call to Port.command be changed / fixed?

aselder commented 1 year ago

We're seeing the same thing

hexchung commented 1 year ago

same

Stanislav-Lapata commented 1 year ago

@lexmag I have the same problem.

Billzabob commented 1 year ago

Same thing here