TransactionException: Negative transaction counter! SHOULD NEVER HAPPEN!
It shouldn't, but it did :)
Here's how to trigger the bug:
1. Start a transaction with clusto.begin_transaction()
2. Do stuff.
3. Commit the transaction: clusto.commit()
4. Try to roll it back: clusto.rollback_transaction() (no exception thrown)
5. Now try to start a new transaction: clusto.begin_transaction()
You'll get the above error. The problem is that rollback_transaction()
doesn't handle the case that the transaction counter exists but it's at
0, which is what happens after the first transaction is committed. It
merrily decrements the transaction counter to -1, and all hell breaks loose.
I'm busy trying to fix the code that caused me to find this bug in the
first place, but I just wanted to get this out there now before I forget
about it. Sometime soon, I'll fix this bug and send the fix along.