jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcel Reutegger (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCR-3417) Failed Journal lock not propagated
Date Tue, 28 Aug 2012 07:09:11 GMT

    [ https://issues.apache.org/jira/browse/JCR-3417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443004#comment-13443004
] 

Marcel Reutegger commented on JCR-3417:
---------------------------------------

The exception is not logged in the core, but propagated all the way up to the JCR API. E.g.
a stack trace will look like this, when the thread is interrupted.

javax.jcr.RepositoryException: Unable to update item: item.save()
	at org.apache.jackrabbit.core.ItemSaveOperation.perform(ItemSaveOperation.java:265)
	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
	at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
	at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:329)
	at org.apache.jackrabbit.core.session.SessionSaveOperation.perform(SessionSaveOperation.java:64)
	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
	at org.apache.jackrabbit.core.SessionImpl.perform(SessionImpl.java:361)
	at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:812)
[...]
Caused by: org.apache.jackrabbit.core.state.ItemStateException: updateCreated failed
	at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:574)
	at org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:1486)
	at org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:1516)
	at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:400)
	at org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:354)
	at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:375)
	at org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:275)
	at org.apache.jackrabbit.core.ItemSaveOperation.perform(ItemSaveOperation.java:258)
	... 10 more
Caused by: org.apache.jackrabbit.core.cluster.ClusterException: Unable to create log entry.
	at org.apache.jackrabbit.core.cluster.ClusterNode$WorkspaceUpdateChannel.updateCreated(ClusterNode.java:618)
	at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:572)
	... 17 more
Caused by: org.apache.jackrabbit.core.journal.JournalException: Unable to acquire write lock.
	at org.apache.jackrabbit.core.journal.AbstractJournal.internalLockAndSync(AbstractJournal.java:297)
	at org.apache.jackrabbit.core.journal.AbstractJournal.lockAndSync(AbstractJournal.java:283)
	at org.apache.jackrabbit.core.journal.DefaultRecordProducer.append(DefaultRecordProducer.java:51)
	at org.apache.jackrabbit.core.cluster.ClusterNode$WorkspaceUpdateChannel.updateCreated(ClusterNode.java:614)
	... 18 more
Caused by: java.lang.InterruptedException
	at java.lang.Object.wait(Native Method)
	at java.lang.Object.wait(Object.java:485)
	at EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock$WriterLock.acquire(Unknown
Source)
	at org.apache.jackrabbit.core.journal.AbstractJournal.internalLockAndSync(AbstractJournal.java:294)
	... 21 more

What client code sees is a RepositoryException with message "Unable to update item: item.save()".
This is existing code and does not change with the patch.
                
> Failed Journal lock not propagated
> ----------------------------------
>
>                 Key: JCR-3417
>                 URL: https://issues.apache.org/jira/browse/JCR-3417
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.5, 1.6, 2.0, 2.1, 2.2, 2.3, 2.4
>            Reporter: Marcel Reutegger
>            Assignee: Marcel Reutegger
>         Attachments: JCR-3417.patch
>
>
> Locking the journal when something is written to the repository happens through the UpdateEventChannel
interface. A callstack will usually look like this:
> at org.apache.jackrabbit.core.journal.AbstractJournal.lockAndSync(AbstractJournal.java:285)
> at org.apache.jackrabbit.core.journal.DefaultRecordProducer.append(DefaultRecordProducer.java:51)
> at org.apache.jackrabbit.core.cluster.ClusterNode$WorkspaceUpdateChannel.updateCreated(ClusterNode.java:598)
> at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:565)
> at org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:1462)
> at org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:1492)
> The current implementation silently ignores any exception that happens inside e.g. UpdateEventChannel.updateCreated(Update)
and proceeds with the update assuming everything is OK. This behaviour may lead to a deadlock
when the Journal lock is later acquired again.
> I suggest to update at least the updateCreated() method to throw a ClusterException and
fail the Update in SharedItemStateManager with an ItemStateException in case the ClusterException
is thrown.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message