Menu

#1 Transactions not handled properly

closed-fixed
None
5
2006-05-23
2006-05-22
axel c.
No

There is a serious problem with the way transactions
are handled. When you nest > 200 child transactions
under a single parent transaction, Env.TxnBegin ()
hangs at an endless loop and the program must be
manually aborted.

The hang happens at
BerkeleyDb.Set<BerkeleyDb.Txn>.FindSlot(BerkeleyDb.Txn
key = {BerkeleyDb.Txn}, out int indx = 60) Line 320 +
0x8 bytes

as reported by the vs2005 debugger.

I think this might be caused by improperly cleaning up
the transactions after being commited or aborted, but i
haven't inspected the libdb-dotnet code properly yet.

I have attached a test case that writes 1000 random
entries to a dummy database: it starts a big
transaction and then tries to write every item under a
child transaction and commit the big one at the end if
all goes well. In my system, the program crashes after
about 250 inserts.

Discussion

  • axel c.

    axel c. - 2006-05-22

    Test case

     
  • Karl Waclawek

    Karl Waclawek - 2006-05-22

    Logged In: YES
    user_id=290026

    This is actually a bug in the hash table (Set<T>) in Util.cs.
    If by some coincidence all slots have been used at least
    once, the insertion would loop forever. Thanks for finding it.
    It has been there for a while (in others of my projects as
    well) - I am surprised it never hit me before.

    The bug is fixed in Util.cs rev. 1.6 in CVS.
    Your example works now for me.
    Please confirm if it works for you.

     
  • Karl Waclawek

    Karl Waclawek - 2006-05-22
    • status: open --> open-fixed
     
  • Karl Waclawek

    Karl Waclawek - 2006-05-22
    • assigned_to: nobody --> kwaclaw
     
  • axel c.

    axel c. - 2006-05-23

    Logged In: YES
    user_id=654072

    Yes, I can confirm it works now.
    Thanks, this bug was hitting me hard! :)

     
  • Karl Waclawek

    Karl Waclawek - 2006-05-23
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Auth0 Logo