THUNKED_TM mismatch with TM.TM

Bug #142129 reported by Brad Clements
2
Affects Status Importance Assigned to Milestone
Zope 2
Won't Fix
Wishlist
Unassigned

Bug Description

THUNKED_TM doesn't seem to have kept pace with TM.TM, with respect to using _finalize instance variable. Also, it releases the lock before setting the instance's registered property to 0, which under heavy load can cause the instance to be re-used without being re-registered.

Here's a patch.

Revision history for this message
Brad Clements (bkc) wrote :
Revision history for this message
Brad Clements (bkc) wrote :

Just wanted to comment about the tpc_abort = abort line at the end of the class.

TM.TM has a similar statement. Since we re-define the abort function, I can't help but feel that tpc_abort still points to the base class (TM.TM) version of abort, not the THUNKED_TM version of abort.

Hence, I added the tpc_abort = abort line. Is that correct?

Revision history for this message
Tres Seaver (tseaver) wrote :

Status: Pending => Deferred

I can't think of a good way to test this. Does it still apply to
the Zope / RDB you work with (I hope that is Zope 2.7)?

Without followup, reject in two weeks.

Tres Seaver (tseaver)
Changed in zope2:
status: Confirmed → Triaged
Revision history for this message
Brad Clements (bkc) wrote :

Hi Tres,

I don't recall receiving your inquiry from 5 years ago, so I didn't reply then.

yes we are using 2.7.2-0

Revision history for this message
Tres Seaver (tseaver) wrote :

Thanks for the confirmation. What RDBMS / DA are you using?

Revision history for this message
Brad Clements (bkc) wrote :

We are using gvibDA and Firebird.

The patch from 2001 is for Zope 2.5.

I see we're currently running Zope 2.7.2-0 and it does not have the THUNK.py patch applied.

However we're running all our Zope instances in single-threaded mode due to unreliability with the DB adapter.

Interesting, I think when upgrading from 2.5 to 2.7.2 we forgot to re-apply our suggested patch. Then Zope got unreliable and instead of figuring it out again and applying the patch, we just moved to single-threaded mode behind Pound.

---

The point of the patch is to make sure that changes to self._registered occur only while the lock is held. Without this change the THUNKED_TM instance can appear as still being registered even when it is no longer registered due to the lock being released (thereby allowing another thread to pick up the THUNKED_TM instance) before self._registered is set to 0

Revision history for this message
Tres Seaver (tseaver) wrote : Re: [zope2-tracker] [Bug 142129] Re: THUNKED_TM mismatch with TM.TM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brad Clements wrote:
> We are using gvibDA and Firebird.
>
> The patch from 2001 is for Zope 2.5.
>
> I see we're currently running Zope 2.7.2-0 and it does not have the
> THUNK.py patch applied.
>
> However we're running all our Zope instances in single-threaded mode
> due to unreliability with the DB adapter.
>
> Interesting, I think when upgrading from 2.5 to 2.7.2 we forgot to re-
> apply our suggested patch. Then Zope got unreliable and instead of
> figuring it out again and applying the patch, we just moved to single-
> threaded mode behind Pound.
>
> ---
>
> The point of the patch is to make sure that changes to self._registered
> occur only while the lock is held. Without this change the THUNKED_TM
> instance can appear as still being registered even when it is no longer
> registered due to the lock being released (thereby allowing another
> thread to pick up the THUNKED_TM instance) before self._registered is
> set to 0

I think I get the point: my worry is that I don't use any "thunked"
database adapter myself, and wouldn't have a way to know that I broke
something,

I know you guys are still running a 2.7.x Zope: would you be able to
test the gvibDA against a 2.12 branch checkout? I will try installing
firebird2.1-classic on my machine and see if I can at least connect and
run SQL queries.

Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkvPkSgACgkQ+gerLs4ltQ4lCQCeJPGUx8UUptML1JBAviFvO/tL
fwUAniPih8WKtoWpIDnryT5kk/Rs4y34
=T7Lk
-----END PGP SIGNATURE-----

Revision history for this message
Tres Seaver (tseaver) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tres Seaver wrote:
> Brad Clements wrote:
>> We are using gvibDA and Firebird.
>
>> The patch from 2001 is for Zope 2.5.
>
>> I see we're currently running Zope 2.7.2-0 and it does not have the
>> THUNK.py patch applied.
>
>> However we're running all our Zope instances in single-threaded mode
>> due to unreliability with the DB adapter.
>
>> Interesting, I think when upgrading from 2.5 to 2.7.2 we forgot to re-
>> apply our suggested patch. Then Zope got unreliable and instead of
>> figuring it out again and applying the patch, we just moved to single-
>> threaded mode behind Pound.
>
>> ---
>
>> The point of the patch is to make sure that changes to self._registered
>> occur only while the lock is held. Without this change the THUNKED_TM
>> instance can appear as still being registered even when it is no longer
>> registered due to the lock being released (thereby allowing another
>> thread to pick up the THUNKED_TM instance) before self._registered is
>> set to 0
>
> I think I get the point: my worry is that I don't use any "thunked"
> database adapter myself, and wouldn't have a way to know that I broke
> something,
>
> I know you guys are still running a 2.7.x Zope: would you be able to
> test the gvibDA against a 2.12 branch checkout? I will try installing
> firebird2.1-classic on my machine and see if I can at least connect and
> run SQL queries.

Ugh, I have to admit defeat there -- stock installs of firefox2.1-super
on my box (Ubuntu Jaunty) failed to bring the server up cleanly.

Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkvPm1wACgkQ+gerLs4ltQ4+OgCgniqr/82DJfrNXltkSl3ndIsR
kpcAn0ejeXJoei+cCplXrPluZpx27o+Q
=7eky
-----END PGP SIGNATURE-----

Revision history for this message
Brad Clements (bkc) wrote :

Tres Seaver wrote:
>
> Ugh, I have to admit defeat there -- stock installs of firefox2.1-super
> on my box (Ubuntu Jaunty) failed to bring the server up cleanly.
>
Yeah, I think it's a dead end.

gvibDA has been unmaintained for ages. In fact, I think I'm listed as
the maintainer somewhere because the original author didn't want to
field any more email inquiries.

gvibDA only compiles with very old versions of swig, so we're stuck
running it on Redhat 3, but all our new servers are ubuntu 9.10.

My client is actually phasing out Zope and moving directly to WSGI +
sqlalchemy. Ever since APE came out (which we jumped on immediately)
Zope has essentially been a legacy framework. They do not use any Zope
specific features.

What are your other choices for ticket status? Do you have one that says
"now too old to test"?

Thanks for trying anyway.

--
Brad Clements, <email address hidden> (315)268-1000
http://www.murkworks.com
AOL-IM: BKClements

Revision history for this message
Tres Seaver (tseaver) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brad Clements wrote:
> Tres Seaver wrote:
>> Ugh, I have to admit defeat there -- stock installs of firefox2.1-super
>> on my box (Ubuntu Jaunty) failed to bring the server up cleanly.
>>
> Yeah, I think it's a dead end.
>
> gvibDA has been unmaintained for ages. In fact, I think I'm listed as
> the maintainer somewhere because the original author didn't want to
> field any more email inquiries.
>
> gvibDA only compiles with very old versions of swig, so we're stuck
> running it on Redhat 3, but all our new servers are ubuntu 9.10.
>
> My client is actually phasing out Zope and moving directly to WSGI +
> sqlalchemy. Ever since APE came out (which we jumped on immediately)
> Zope has essentially been a legacy framework. They do not use any Zope
> specific features.
>
> What are your other choices for ticket status? Do you have one that says
> "now too old to test"?
>
> Thanks for trying anyway.

Thanks for the update -- I've marked it "Won't Fix".

Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkvPpA8ACgkQ+gerLs4ltQ6nfQCfYwHDGJ4gxPhta3LUx5J+JHdY
70cAoIU2p0hw/vk/yBtvtSdZhH3npeHJ
=CD7I
-----END PGP SIGNATURE-----

Changed in zope2:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.