The connection pool is safe in single process multiple threads.  It breaks
on fork() because the socket travels across the process boundary and is
essentially copied between two or more processes that are unaware of each
other.

On Wed, Apr 10, 2019, 2:55 PM Jonathan Vanasco <jvana...@gmail.com> wrote:

>
>
> On Wednesday, April 10, 2019 at 1:17:01 PM UTC-4, Mike Bayer wrote:
>>
>> op, you're right, that is a thing.    Not sure if mod_wsgi makes it
>> easy to make that mistake though, that is, I thought all the Python
>> happens after the fork.   Well, if they are using daemon mode which
>> you definitely should always be using.
>>
>
> He's running Pyramid with 1 process and 10 threads, which causes the same
> underlying issue -- db connections in shared memory -- except it's across
> threads instead of processes.
>
> This could be caused by something else... but this is an error which is
> highly typical to initializing a database connection before a fork/thread.
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full
> description.
> ---
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to