Re: Psycopg 2.2.x issue with PgBouncer

Federico Di Gregorio <fog-NGVKUo/i/[email protected]> Sun, 25 Jul 2010 11:50:56 +0200
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============0935974883216110973==
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enig8EEFD9200252661AEC0D5916"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig8EEFD9200252661AEC0D5916
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 25/07/2010 02:43, Daniele Varrazzo wrote:
> On Sat, Jul 24, 2010 at 3:18 PM, Jan Urba=C5=84ski <[email protected]=
> wrote:
>=20
>> > I fixed it in two ways. First, the code keeps a flag that tells if
>> > deallocation is underway. If the flag is set, the deallocation funct=
ion
>> > is a noop (this prevents recursive invocation).
>> >
>> > Second, if deallocation is underway, the green execution method is n=
ever
>> > used (it always blocks). That's not ideal, but otherwise it would me=
an
>> > calling the user-defined callback with the connection object as an
>> > argument that has zero refs... Not sure how this could be fixed.
>> >
>> > Note that with the second fix the first is not needed, as we bypass
>> > green execution mode and so won't trigger recursive dealloc. I still=

>> > think it's useful to have a guard there, in case later on we start d=
oing
>> > someting in the connection_dealloc function that will cause similar =
issues.
> Thank you for these patches. I think not dropping into the wait
> callback is compulsory when the refcount of the connection is zero.
> This leads to the only solution of issuing the final rollback in
> blocking mode. I think it's perfectly fine, as people can always issue
> a manual close before gc-ing the connection. I would add a note about
> that in the documentation.

Merged. Given this fixes a regression I'll do a release ASAP.

federico

--=20
Federico Di Gregorio                                       fog-NGVKUo/i/[email protected]
                             Domani si vede domani. -- Alessandra O'Hara


--------------enig8EEFD9200252661AEC0D5916
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxMCQcACgkQvcCgrgZGjevqiwCgzJQp64bt3C+gVzccQfm9iRUi
t5UAnjrIrYjUQqGgtD9E9K0WeLySXiUV
=EJLD
-----END PGP SIGNATURE-----

--------------enig8EEFD9200252661AEC0D5916--

--===============0935974883216110973==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/psycopg

--===============0935974883216110973==--