onyx icon indicating copy to clipboard operation
onyx copied to clipboard

Cache SA engine by running PID

Open moshe opened this issue 10 months ago • 1 comments

I see that the updater.py script sometimes forks, making two different processes use the same engine. This triggers SSL errors from the Postgres connection that uses TLS for communication. The fix is to cache the engine by the running pid. The existing comment mentions that the connection should be made according to the process.

# global so we don't create more than one engine per process

error:

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) SSL error: decryption failed or bad record mac

moshe avatar Apr 24 '24 18:04 moshe

@moshe is attempting to deploy a commit to the Danswer Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Apr 24 '24 18:04 vercel[bot]

Hey @moshe, thanks so much for addressing this! I didn't see this PR, and in the meantime have put in a fix here (https://github.com/danswer-ai/danswer/pull/1399/files), which should accomplish the same thing. Let me know if you're still running into any issues here 🧐

Weves avatar May 07 '24 23:05 Weves