manukall

manukall

Since a few days ago I keep getting the following error on my dev machine when making requests to a phoenix app:

exited in: :gen_server.call(#PID<0.656.0>, {:checkout, #Reference<0.1406881335.1305214977.237415>, true, 15000}, 5000) ** (EXIT) time out

It seems like the app works for some time and then the error happens for every request. Sometimes restarting Postgres or the app fixes the problem again for some time, but sometimes not. I suspect it maybe just works again after something times out.

I’m not sure what changed since I’ve last worked on this project some weeks ago. I’ve tried downgrading Postgresql and Elixir and also completely removed Postgresql, including the data directory.

The Phoenix logs for the affected requests show several successful queries before the error happens. It feels like connections are not checked in to the pool again, but I’ve no idea if that’s really true or where to start debugging. The same app works on a different laptop without those issues, though.

I’m on Arch Linux with Postgres 10.4, Ecto 2.2.10 and postgres 0.13.5.

Showing Posts 1 to 10

hubertlepicki

hubertlepicki

it’s difficult to answer but what is happening IMHO is that Ecto can’t check out a connection from the pool for some reason as all connections are being used.

It is possible that your app is doing something in background, or you are (even in dev) making so many parallel requests, or doing some long-running operations that they are not getting freed in time for other requests to pick up.

Can you tell me what’s your pool size config option is in dev mode, and also try to possibly bump it up to something like 30 and see if that sorts things out?

manukall

manukall OP

That’s what I thought, too. I’ve tried increasing pool_size and pool_overflow to 50, though and it didn’t help.

Also, from the logs it looks like maybe 6 or 7 queries are made before the timeout, so it shouldn’t be enough to exhaust the pool.

The only thing I know I’ve done since it worked was running some system upgrades. I’ve downgraded postgres again though.

manukall

manukall OP

Update: Seems to only happen with Erlang 20.3. After downgrading to 20.2.2, everything works again. My other project on the same machine was using 20.2.2. When I upgrade Erlang there to 20.3 it’s broken, too.

I’d like to raise this as a bug somewhere, but I’ve no idea where. I don’t know if it’s an issue with Erlang, Ecto, Postgrex, Poolboy, …

dom

dom

That timeout would be on DBConnection. There’s a comment on a similar issue here:

https://github.com/elixir-ecto/db_connection/issues/107#issuecomment-347601857

I would also suggest rm -rf _build then recompiling, just to be sure there’s no weirdness.

hubertlepicki

hubertlepicki

Oh that’s interesting. I am not using 20.3 yet but it seems like a good opportunity to update one of the projects and see if I can replicate your problem. I have got one that’s matching Ecto and postgrex versions to your set up, and is reasonably big so it will be a good test.

It might be a bug in poolboy or database_connection on this specific version of Erlang.

hubertlepicki

hubertlepicki

Just to give you an update, so far in development I saw no such issues :(. We are going to deploy to staging an update some time today and we’ll see if it’ll be caught there. It’s weird.

manukall

manukall OP

thanks. it’s very weird. we’re only seeing the issue on my machine running arch linux. on a macbook and our ubuntu servers everything is fine. maybe it only happens with very recent postgres versions.

hubertlepicki

hubertlepicki

Damn, I migrated from Arch to Ubuntu last year :(.

manukall

manukall OP

good for you in this case :wink:

hubertlepicki

hubertlepicki

Well I had issues setting up Docker projects and just got fed up with constantly fighting with Arch and I’m already 33 so you know, too old to fight against my dev machine like that all the time.

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews