elixir-ecto / db_connection

Database connection behaviour
http://hexdocs.pm/db_connection/DBConnection.html
306 stars 113 forks source link

How to avoid starting Sojourn? #109

Closed sauvainr closed 6 years ago

sauvainr commented 6 years ago

Hi, we are using a module using poolboy based on this project, I notice Sojourn process being started anyway. From https://github.com/elixir-ecto/db_connection/blob/188e99191df55ffe1e5927637c79a8c638bc1117/lib/db_connection/app.ex#L10

Is it intended? How to prevent Sojourn pool to start if using poolboy? Could we have the pool module as parameter or so instead?

Thanks

michalmuskala commented 6 years ago

It's not starting sojurn pool, it's only a supervisor for supervising sojurn pools if they are started - this shouldn't cause any issues.

fishcakez commented 6 years ago

Could we have the pool module as parameter or so instead?

The already exists, pool: DBConnection.Poolboy: https://github.com/elixir-ecto/db_connection/blob/188e99191df55ffe1e5927637c79a8c638bc1117/lib/db_connection.ex#L539-L540 In Ecto this is the default pool so don't need to set it there.

sauvainr commented 6 years ago

Thanks for the quick answer, so basically the Sojourn supervisor is running idle when using poolboy?

Not an issue but surprising when troubleshooting db connection pools.

fishcakez commented 6 years ago

Thanks for the quick answer, so basically the Sojourn supervisor is running idle when using poolboy?

Its empty yes.