Forum OpenACS Development: Re: Deadlocks

Collapse
2: Re: Deadlocks (response to 1)
Posted by Gustaf Neumann on
oh no, not again. Which application caused this?

Your examples show deadlocks on

  • insert into acs_object_context_index
triggered from
  • acs_rel__new, membership_rel__new, and
  • contact_party_revision__new, content_revision__new, and
  • content_folder__new, content_item__new
For performance reasons, we do not want to lock the most inner part (acs_objects, acs_object_context_index), but the higher level operations. We have locks already for content_item_new and content_revsion_new, but only on the tcl level. In your cases 2 and 3, the stored procedures are called directly from other stored procedures.

Please, do the following: add
LOCK TABLE acs_objects IN SHARE ROW EXCLUSIVE MODE
to the stored procedures content_revision__new, content_item__new and acs_rel__new, and delete the locks from tcl. This should not hurt performance to much and your problem should go away.

Collapse
3: Re: Deadlocks (response to 2)
Posted by Malte Sussdorff on
I solved the problem with content_folder__new by making content::folder::new call content::item::new directly.

I solved content_party_revision__new by calling content::revision::new within contact::party::revision.

I added the lock to acs_rel__new and commit on HEAD.