On Tue, Feb 18, 2014 at 4:08 PM, Michael Bayer <[email protected]> wrote:

> OK some questions:
>
> 1. what options are you passing to create_engine()?

sqlalchemy.default.url = postgresql://DBNAME:DBPASS@DBADDRESS/DBNAME
sqlalchemy.default.client_encoding=utf8
sqlalchemy.default.pool_recycle = 3600
sqlalchemy.default.pool_size=20
sqlalchemy.default.max_overflow=30


> 2. what kind of column types and data do you have in the table that is mapped 
> to the “users” mapping denoted by:
>
>         self.organization.users
>
> ?

Lots of types, mostly Unicode() column fields, DateTime, Integer, Boolean

> 3. are you running with the C extensions installed?   what happens 
> differently if you run without the C extensions? (depends on how reproducible 
> this is)  the stack trace doesn’t say much here as it seems like C code is 
> where things are going wrong.

We're running with the C extension, haven't tried without as it's a
bit cumbersome to update our machines to run without it.

> 4. is this error only under load ?
>
> it may be the issue noted by Jeff in another email, or not.

Nah, this issue is all the time, with or without load and we applied
Jeff fix and so far, early to say as it's a race condition, the errors
have gone away. Maybe in the next couple of days they won't come back
and we can consider it fixed.

> 5. Potential workaround, assuming the issue is the one Jeff refers to.   Do 
> this in your application startup, *before* any requests are served:
>
> # create engine normally
> eng = create_engine(…)
>
> # initialize the dialect.
> conn = eng.connect()
> conn.close()

Oh, is that enough? We're running an eng.execute("select 1; rollback;").

> specifically, do the above anytime you are calling create_engine().  Note 
> that the app would ideally be calling create_engine() only once per URL.  If 
> your app is using an anti pattern like “create_engine per operation” or 
> something like that, that could cause more problems (even it not, it is very 
> non-performant).

Nah, we're using the create_engine one per app. :).

> 6. more extreme workaround, if Amazon RDS is being weird here:
>
>
> # create engine normally
> eng = create_engine(…)
>
> # initialize the dialect.
> conn = eng.connect()
> conn.close()
>
> # override the unicode returns detection to force SQLAlchemy to check for
> # decode in all cases (will perform poorly if no C extensions are in use or 
> pre-0.9.2 in use)
> eng.dialect.returns_unicode_strings = “conditional"

We've used RDS also with the 0.7.9 version of sqlalchemy and it didn't
give any issues.

I cannot stress enough how as soon as we deployed 0.9.2 these errors
started while with 0.7.9 there were none and that's mostly the only
change we've done.

-- 
Valentino Volonghi | Chief Architect
P: +1-877-723-7655 | F: +1-415-738-8026
AdRoll.com Increase Sales. Raise Awareness.

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to