Hi everybody,
I’m trying to unsuccessfully change the connection timeout using the Mariex lib.
[error] Mariaex.Protocol (#PID <0.268.0>) disconnected: ** (DBConnection.ConnectionError) client #PID <0.266.0> timed out because it checked out the connection for more than 5000ms
I’m using phoenix and performing a heavy query on a mysql database. Anyone know how to change this using phoenix ?
Thank you all
Try playing with the timeout options:
execute(conn, query, params, pool_timeout: 60_000, timeout: 60_000)
I’m doing it this way, and returned the error below 
{:ok, p} = Mariaex.start_link(username: "username", database: "database", password: "password", hostname: "hostname")
Mariaex.execute(p, "query", [], pool_timeout: 60_000, timeout: 60_000)
** (FunctionClauseError) no function clause matching in Mariaex.execute/4
(mariaex) lib/mariaex.ex:239: Mariaex.execute(#PID<0.268.0>, "query", [], [pool_timeout: 60000, timeout: 60000])
And before with Mariex.query gave this problem
[error] Mariaex.Protocol (#PID<0.268.0>) disconnected: ** (Mariaex.Error) [tcp] `recv` failed with: :timeout
{:error,
%Mariaex.Error{action: "recv", connection_id: #PID<0.268.0>, mariadb: nil,
message: nil, reason: :timeout, tag: :tcp}}
Thanks for the answer @voughtdq
I was doing the iex. When I did it right on the phoenix it worked out the timeout.
Thank you all
@AstonJ , I tried editing Mariex for Mariaex in the post and the tag I created but I could not. Can you adjust to be correct?
1 Like