Hi, I've recently seen a situation where zope.sqlalchemy locked up the transaction machinery. I'm not sure exactly what happened, but have attached a failing test for at least one bug which may have caused it. Hopefully it's self explanatory;) If someone could help me solve this, that would be great! -- Brian Sutherland
Brian Sutherland wrote:
Hi,
I've recently seen a situation where zope.sqlalchemy locked up the transaction machinery. I'm not sure exactly what happened, but have attached a failing test for at least one bug which may have caused it. Hopefully it's self explanatory;)
If someone could help me solve this, that would be great!
Could you try this with latest trunk. I checked in a fix the other day that may help. Laurence
On Tue, Sep 16, 2008 at 02:01:07PM +0100, Laurence Rowe wrote:
Brian Sutherland wrote:
Hi,
I've recently seen a situation where zope.sqlalchemy locked up the transaction machinery. I'm not sure exactly what happened, but have attached a failing test for at least one bug which may have caused it. Hopefully it's self explanatory;)
If someone could help me solve this, that would be great!
Could you try this with latest trunk. I checked in a fix the other day that may help.
Nope the test definitely errors with the latest trunk.
Laurence
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
-- Brian Sutherland
On Tue, Sep 16, 2008 at 02:01:07PM +0100, Laurence Rowe wrote:
Brian Sutherland wrote:
Hi,
I've recently seen a situation where zope.sqlalchemy locked up the transaction machinery. I'm not sure exactly what happened, but have attached a failing test for at least one bug which may have caused it. Hopefully it's self explanatory;)
If someone could help me solve this, that would be great!
Could you try this with latest trunk. I checked in a fix the other day that may help.
The specific error I get is this. Basically, it looks like the session state is deleted but the actual commit fails. As the session state is deleted, the abort() always fails, preventing you from either committing or aborting the transaction. Error in test testAbortAfterCommit (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/unittest.py", line 260, in run testMethod() File "/Users/jinty/src/zope.sqlalchemy/src/zope/sqlalchemy/tests.py", line 189, in testAbortAfterCommit transaction.abort() File "/Users/jinty/.buildout/eggs/transaction-1.0a1-py2.5.egg/transaction/_manager.py", line 96, in abort return self.get().abort() File "/Users/jinty/.buildout/eggs/transaction-1.0a1-py2.5.egg/transaction/_transaction.py", line 468, in abort rm.abort(self) File "/Users/jinty/src/zope.sqlalchemy/src/zope/sqlalchemy/datamanager.py", line 54, in abort del _SESSION_STATE[id(self.session)] KeyError: 18171152
Laurence
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
-- Brian Sutherland
On Tue, Sep 16, 2008 at 02:01:07PM +0100, Laurence Rowe wrote:
Brian Sutherland wrote:
Hi,
I've recently seen a situation where zope.sqlalchemy locked up the transaction machinery. I'm not sure exactly what happened, but have attached a failing test for at least one bug which may have caused it. Hopefully it's self explanatory;)
If someone could help me solve this, that would be great!
Could you try this with latest trunk. I checked in a fix the other day that may help.
I just checked in a fix, please feel free to comment on/revert it if it's not up to standard:)
Laurence
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
-- Brian Sutherland
Brian Sutherland wrote:
On Tue, Sep 16, 2008 at 02:01:07PM +0100, Laurence Rowe wrote:
Brian Sutherland wrote:
Hi,
I've recently seen a situation where zope.sqlalchemy locked up the transaction machinery. I'm not sure exactly what happened, but have attached a failing test for at least one bug which may have caused it. Hopefully it's self explanatory;)
If someone could help me solve this, that would be great! Could you try this with latest trunk. I checked in a fix the other day that may help.
I just checked in a fix, please feel free to comment on/revert it if it's not up to standard:)
Great, I'll take a look at it and do a release some time this week. Laurence
Brian Sutherland wrote at 2008-9-17 12:33 +0200:
On Tue, Sep 16, 2008 at 02:01:07PM +0100, Laurence Rowe wrote:
Brian Sutherland wrote:
Hi,
I've recently seen a situation where zope.sqlalchemy locked up the transaction machinery. I'm not sure exactly what happened, but have attached a failing test for at least one bug which may have caused it. Hopefully it's self explanatory;)
If someone could help me solve this, that would be great!
Could you try this with latest trunk. I checked in a fix the other day that may help.
I just checked in a fix, please feel free to comment on/revert it if it's not up to standard:)
It looks not yet right to clear the state in "tpc_vote" when a two phase commit is used (which is now supported by "SQLAlchemy"). In addition, there may be a problem in case "session.close()" raises an exception. Then, "_finish" would not be called. -- Dieter
On Thu, Sep 18, 2008 at 07:08:56AM +0200, Dieter Maurer wrote:
Brian Sutherland wrote at 2008-9-17 12:33 +0200:
On Tue, Sep 16, 2008 at 02:01:07PM +0100, Laurence Rowe wrote:
Brian Sutherland wrote:
Hi,
I've recently seen a situation where zope.sqlalchemy locked up the transaction machinery. I'm not sure exactly what happened, but have attached a failing test for at least one bug which may have caused it. Hopefully it's self explanatory;)
If someone could help me solve this, that would be great!
Could you try this with latest trunk. I checked in a fix the other day that may help.
I just checked in a fix, please feel free to comment on/revert it if it's not up to standard:)
It looks not yet right to clear the state in "tpc_vote" when a two phase commit is used (which is now supported by "SQLAlchemy").
It looks to me that in a two phase commit, the tpc_vote which is called is: def tpc_vote(self, trans): if self.tx is not None: # there may have been no work to do self.tx.prepare() self.state = 'voted' is that what you mean by clearing state?
In addition, there may be a problem in case "session.close()" raises an exception. Then, "_finish" would not be called.
I modified my patch, moving session.close() into _finish and actually calling close() after the state is cleared. That way, the errors can propagate, but the transaction will not get wedged. -- Brian Sutherland
Brian Sutherland wrote at 2008-9-18 10:00 +0200:
... It looks to me that in a two phase commit, the tpc_vote which is called is:
def tpc_vote(self, trans): if self.tx is not None: # there may have been no work to do self.tx.prepare() self.state = 'voted'
is that what you mean by clearing state?
I have not recognized that there are two implementations for "tpc_vote" -- my criticims was against the wrong one. -- Dieter
Am Donnerstag 18 September 2008 07:08:56 schrieb Dieter Maurer:
Brian Sutherland wrote at 2008-9-17 12:33 +0200:
On Tue, Sep 16, 2008 at 02:01:07PM +0100, Laurence Rowe wrote:
Brian Sutherland wrote:
Hi,
I've recently seen a situation where zope.sqlalchemy locked up the transaction machinery. I'm not sure exactly what happened, but have attached a failing test for at least one bug which may have caused it. Hopefully it's self explanatory;)
If someone could help me solve this, that would be great!
Could you try this with latest trunk. I checked in a fix the other day that may help.
I just checked in a fix, please feel free to comment on/revert it if it's not up to standard:)
It looks not yet right to clear the state in "tpc_vote" when a two phase commit is used (which is now supported by "SQLAlchemy").
In addition, there may be a problem in case "session.close()" raises an exception. Then, "_finish" would not be called.
This may not be connected, but I just wanted to point out a problem with configurations with "autoflush=False". If I change some database object attributes in the session but do not call session.flush(), the data is not stored into the database, as no commit() is called, which would then flush out/commit the data. So perhaps this is something to think about, or, at least something to be denoted in the documentation. I circumvented the problem by setting autoflush=True and modifying my code so that it works (although it's quite complicated). Best Regards, Hermann -- hermann@qwer.tk GPG key ID: 299893C7 (on keyservers) FP: 0124 2584 8809 EF2A DBF9 4902 64B4 D16B 2998 93C7
Brian Sutherland wrote at 2008-9-16 09:56 +0200:
I've recently seen a situation where zope.sqlalchemy locked up the transaction machinery. I'm not sure exactly what happened, but have attached a failing test for at least one bug which may have caused it. Hopefully it's self explanatory;)
If someone could help me solve this, that would be great!
We have seen similar problems and hope to understand/work around them soon. -- Dieter
participants (4)
-
Brian Sutherland -
Dieter Maurer -
Hermann Himmelbauer -
Laurence Rowe