From 4f8e48df7c8497f53d6df96e81a437b95fe7f8c6 Mon Sep 17 00:00:00 2001 From: "Richard Kuo (Danswer)" Date: Mon, 13 Jan 2025 11:50:04 -0800 Subject: [PATCH] try more sql settings --- backend/onyx/background/celery/apps/indexing.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/onyx/background/celery/apps/indexing.py b/backend/onyx/background/celery/apps/indexing.py index 89681ea741e0..a241ff19b008 100644 --- a/backend/onyx/background/celery/apps/indexing.py +++ b/backend/onyx/background/celery/apps/indexing.py @@ -60,9 +60,13 @@ def on_worker_init(sender: Worker, **kwargs: Any) -> None: SqlEngine.set_app_name(POSTGRES_CELERY_WORKER_INDEXING_APP_NAME) - # rkuo: been seeing transient connection exceptions here, so upping the connection count - # from just concurrency/concurrency to concurrency/concurrency*2 - SqlEngine.init_engine(pool_size=sender.concurrency, max_overflow=8) # type: ignore + # rkuo: Transient errors keep happening in the worker threads for indexing + # "SSL connection has been closed unexpectedly" + # fixing spawn method didn't help (although it seemed like it should) + # setting pre ping might help. + SqlEngine.init_engine( + pool_size=sender.concurrency, max_overflow=8, pool_pre_ping=True + ) # type: ignore app_base.wait_for_redis(sender, **kwargs) app_base.wait_for_db(sender, **kwargs)