Hello!

We're running an application under gunicorn that stores the session a
postgresql database (it saves > 2 Mb info so memcached is not an
option) and sometimes it's not able to save the sessions. We have
added logs in the session and in the database and we see that
sometimes the session middleware makes a rollback and does not save
the session in the database. We don't have any error log

We have log sid and transactions activaded (log_line_prefix = '%t %c %x '  )
Here you can see log for sid 4d109548.3bb3, with transaction 401214 rolled back:

-------------
[...]
2010-12-21 12:53:45 CET 4d109548.3bb3 0 LOG:  duration: 0.041 ms
statement: BEGIN; SET TRANSACTION ISOLATION LEVEL READ COMMITTED
2010-12-21 12:53:45 CET 4d109548.3bb3 0 LOG:  duration: 0.019 ms
statement: SAVEPOINT s67396208_x1
2010-12-21 12:53:45 CET 4d109548.3bb3 0 LOG:  duration: 0.267 ms
statement: SELECT (1) AS "a" FROM "django_session" WHERE
"django_session"."session_key" = E'0928108749f2
8807a6501839e801912a'  LIMIT 1
2010-12-21 12:53:45 CET 4d109548.3bb3 401214 LOG:  duration: 2.381 ms
statement: UPDATE "django_session" SET "session_data" =
E'gAJ9cQEoVQtkaXNwb19yZXBseXECXXEDKGN3ZWJfY
jJjLnNlcnZpY2UKRGlzcG9SZXN1bHQKcQQp
        
gXEFfXEGKFUEbGFuZ3EHVQNFU1BxCFUGX2hvdGVscQljZGphbmdvLmRiLm1vZGVscy5iYXNlCm1v
        [... session data ...]
        Y2RiNTU2YmYxMjNlOTNmYTNmYjlhYmIyYmM5YQ==
        ', "expire_date" = E'2011-01-04 12:53:45.409949' WHERE
"django_session"."session_key" = E'0928108749f28807a6501839e801912a'
2010-12-21 12:53:45 CET 4d109548.3bb3 0 LOG:  duration: 0.052 ms
statement: ROLLBACK
[...]
---------------

Usually everything rules like a charm, but from time to time we have
this kind of issue. We have also updated to the last psycopg2, just in
case, but without luck.

Any ideas would be greatly appreciated

Best regards,

-- 
Antoni Aloy López
Blog: http://trespams.com
Site: http://apsl.net

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to