onyx
onyx copied to clipboard
Cache SA engine by running PID
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 is attempting to deploy a commit to the Danswer Team on Vercel.
A member of the Team first needs to authorize it.
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 🧐