plausible / ecto_ch

Ecto ClickHouse adapter
MIT License
72 stars 10 forks source link

Errors logged after using the BREAK menu #134

Closed edwardsmit closed 11 months ago

edwardsmit commented 11 months ago

I get multiple errors like 16:08:49.975 [error] Ch.Connection (#PID<0.217.0>) disconnected: ** (Mint.TransportError) socket closed

After selecting any action in the beam break menu.

To recreate this start a project that actively uses the ecto_ch adapter, press ctrl-c, press c to continue, and see multiple error lines.

ruslandoga commented 11 months ago

The root cause seems to be somewhere in gen_tcp:

iex(25)> {:ok, socket} = :gen_tcp.connect({127, 0, 0, 1}, 8123, [:binary])
{:ok, #Port<0.8>}
iex(26)> flush
:ok
iex(27)> :gen_tcp.send(socket, "GET /ping HTTP/1.1\r\n\r\n")
:ok
iex(28)> flush
{:tcp, #Port<0.8>,
 "HTTP/1.1 200 OK\r\nDate: Fri, 27 Oct 2023 15:00:10 GMT\r\nConnection: Keep-Alive\r\nContent-Type: text/html; charset=UTF-8\r\nTransfer-Encoding: chunked\r\nKeep-Alive: timeout=3\r\nX-ClickHouse-Summary: {\"read_rows\":\"0\",\"read_bytes\":\"0\",\"written_rows\":\"0\",\"written_bytes\":\"0\",\"total_rows_to_read\":\"0\",\"result_rows\":\"0\",\"result_bytes\":\"0\"}\r\n\r\n4\r\nOk.\n\r\n0\r\n\r\n"}
:ok
iex(29)>
BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
       (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution
c
iex(29)>
nil
iex(30)> :gen_tcp.send(socket, "GET /ping HTTP/1.1\r\n\r\n")
{:error, :closed}
iex(31)> flush
{:tcp_closed, #Port<0.8>}

Not sure what we can do about this 😅


Sorry for multiple comments, github doesn't seem to allow me copy-paste code into edited messages for some reason

ruslandoga commented 11 months ago

Closing as this is not something we can fix in ecto_ch