Bug: ssl error with postgres and celery
Mads Kiilerich
mads at kiilerich.com
Thu Nov 5 00:11:54 UTC 2020
On 11/3/20 5:08 PM, Valentin Kleibel wrote:
> Hi,
>
> We are using kallithea with a postgres database on another server
> connected via ssl.
> It seems that celery in version 4 uses prefork in its worker pool
> model now, which leads to issues with such a database connection:
I think you are right something is wrong.
First, the celery-run will not only take a config file as parameter and
read it. It will also initialize the WSGI app and database connection,
before calling into celery. Effectively making it pre-fork. I think you
are right that we only should initialize things after celery has forked
and started worker processes.
But also, it might be a bit odd that we have the celery-run entry point.
It would perhaps be better to somehow use "celery" as entry point and
let it call into Kallithea in each worker. But I haven't investigated
how feasible that would be.
As a workaround, can you use celery.worker_concurrency = 1 but launch
celery-run several times?
/Mads
More information about the kallithea-general
mailing list