Bug 113447

Summary: Database deadlock with multipe users Publishing/Unpublishing.
Product: [Retired] Red Hat Enterprise CMS Reporter: Jon Orris <jorris>
Component: otherAssignee: Vadim Nasardinov <vnasardinov>
Status: CLOSED WONTFIX QA Contact: Jon Orris <jorris>
Severity: medium Docs Contact:
Priority: medium    
Version: nightlyCC: archit.shah
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-08-03 18:17:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
CCM log running on oracle
none
CCM Llog running on Postgres none

Description Jon Orris 2004-01-14 00:13:53 UTC
Description of problem:
#39279 on Postgres & Oracle.

If multiple users are publishing and unpublishing content, database
deadlocks may occur. The root of the problem may be the following
stack trace, which occurs in Oracle before the deadlock exceptions are
encountered:

java.lang.IllegalStateException: Attempt to delete non-empty folder
[com.arsdigita.cms.Folder:{id=337}]; only empty folders can be deleted
	at com.arsdigita.cms.Folder.delete(Folder.java:158)
	at com.arsdigita.cms.ContentItem.setLive(ContentItem.java:1168)
	at com.arsdigita.cms.ContentItem.unpublish(ContentItem.java:1274)
	at com.arsdigita.cms.Folder.unpublish(Folder.java:364)
	at com.arsdigita.cms.ContentItem.setLive(ContentItem.java:1178)
	at com.arsdigita.cms.ContentItem.unpublish(ContentItem.java:1274)
	at com.arsdigita.cms.ContentItem.setLive(ContentItem.java:1178)
	at com.arsdigita.cms.ContentItem.unpublish(ContentItem.java:1274)
	at
com.arsdigita.cms.ui.lifecycle.ItemLifecycleItemPane$UnpublishLink$Listener.actionPerformed(ItemLifecycleItemPane.java:126)

What appears to be happening is that Publishing is a separate thread
that takes an Item from Pending to Live. When a different login
Unpublishes the only item in a folder, it attempts to delete the
'empty' Live folder as part of the transaction. However, the Publish
task has, in the interim, put a Live item in that folder. This is
possible as we do not do the sort of table/row level locking that
would prevent it.

Comment 1 Jon Orris 2004-01-14 00:14:34 UTC
Created attachment 96961 [details]
CCM log running on oracle

Comment 2 Jon Orris 2004-01-14 00:15:19 UTC
Created attachment 96962 [details]
CCM Llog running on Postgres

Comment 3 Jon Orris 2004-01-14 00:17:38 UTC
Test:
//cms/internal/dev/test/src/com/arsdigita/cms/httpunit/CMSTester.java

Next step: examine database logs & lock file to verify this is the
source of the locking problem.


Comment 4 Vadim Nasardinov 2005-08-03 18:17:17 UTC
Cleaning up stale bugs.