[OS-JIRA] Created: (CAY-297) deadlock between commit and external event

From: jira-norepl..bjectstyle.org
Date: Wed Mar 23 2005 - 09:56:18 EST

  • Next message: Damir Bijuklic: "Firebird generators"

    Message:

      A new issue has been created in JIRA.

    ---------------------------------------------------------------------
    View the issue:

      http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-297

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-297
        Summary: deadlock between commit and external event
           Type: Bug

         Status: Assigned
       Priority: Major

        Project: Cayenne
     Components:
                 Cayenne Core Library
       Versions:
                 1.1

       Assignee: Andrus Adamchik
       Reporter: Chris Dawes

        Created: Wed, 23 Mar 2005 9:55 AM
        Updated: Wed, 23 Mar 2005 9:55 AM
    Environment: one webapp on tomcat-4.1.31, j2sdk-1.4.2-06, cayenne-1.1RC3;
    two simple java programs;
    cayenne cache shared using jgroups over multicast udp (some fairly heavy traffic)

    Description:
    http request processing thread does a commit
    at the same time, EventManager receives an external event from jgroups

    the commit locks a DataRowStore then a DispatchQueue
    the external event causes a DispatchQueue then the DataRowStore to be locked.

    I have enough traffic coming in from external events that on a far too frequent basis, these two operations will collide and result in deadlock.

    The following is a stack-trace obtained from the JVM by sending a SIGQUIT to the Tomcat process group (apologies if the formatting is off):

    "PullPushAdapterThread" daemon prio=1 tid=0x087e7cd8 nid=0x6f91 waiting for monitor entry [b89ff000..b89ff8d8]
            at org.objectstyle.cayenne.access.DataRowStore.processRemoteEvent(DataRowStore.java:391)
            - waiting to lock <0x45875100> (a org.objectstyle.cayenne.access.DataRowStore)
            at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.objectstyle.cayenne.util.Invocation.fire(Invocation.java:226)
            at org.objectstyle.cayenne.event.EventManager$Dispatch.fire(EventManager.java:409)
            at org.objectstyle.cayenne.event.DispatchQueue.dispatchEvent(DispatchQueue.java:183)
            at org.objectstyle.cayenne.event.DispatchQueue.dispatchEvent(DispatchQueue.java:98)
            - locked <0x45876888> (a org.objectstyle.cayenne.event.DispatchQueue)
            at org.objectstyle.cayenne.event.EventManager.dispatchEvent(EventManager.java:353)
            at org.objectstyle.cayenne.event.EventManager.postEvent(EventManager.java:324)
            at org.objectstyle.cayenne.event.EventBridge.onExternalEvent(EventBridge.java:209)
            at com.wapmx.monitoring.cayenne.jgroups.CustomJGroupsBridge.onExternalEvent(CustomJGroupsBridge.java:38)
            at org.objectstyle.cayenne.event.JavaGroupsBridge.receive(JavaGroupsBridge.java:141)
            at org.jgroups.blocks.PullPushAdapter.handleMessage(PullPushAdapter.java:282)
            at org.jgroups.blocks.PullPushAdapter.run(PullPushAdapter.java:190)
            at java.lang.Thread.run(Thread.java:534)

    "http-42080-Processor4" daemon prio=1 tid=0x083fad28 nid=0x6f26 waiting for monitor entry [bd3fe000..bd3ff8d8]
            at org.objectstyle.cayenne.event.DispatchQueue.dispatchEvent(DispatchQueue.java:94)
            - waiting to lock <0x45876888> (a org.objectstyle.cayenne.event.DispatchQueue)
            at org.objectstyle.cayenne.event.EventManager.dispatchEvent(EventManager.java:353)
            at org.objectstyle.cayenne.event.EventManager.postEvent(EventManager.java:324)
            at org.objectstyle.cayenne.access.DataRowStore.sendUpdateNotification(DataRowStore.java:546)
            at org.objectstyle.cayenne.access.DataRowStore.processSnapshotChanges(DataRowStore.java:423)
            - locked <0x45875100> (a org.objectstyle.cayenne.access.DataRowStore)
            at org.objectstyle.cayenne.access.ObjectStore.objectsCommitted(ObjectStore.java:564)
            - locked <0x4596aa00> (a org.objectstyle.cayenne.access.ObjectStore)
            at org.objectstyle.cayenne.access.ContextCommit.commit(ContextCommit.java:215)
            - locked <0x45875100> (a org.objectstyle.cayenne.access.DataRowStore)
            - locked <0x4596aa00> (a org.objectstyle.cayenne.access.ObjectStore)
            at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1266)
            - locked <0x4596aa00> (a org.objectstyle.cayenne.access.ObjectStore)
            at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1236)
            at com.wapmx.monitoring.admin.ChartImagesPage.removeImageAction(ChartImagesPage.java:59)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.apache.tapestry.listener.ListenerMap.invokeTargetMethod(ListenerMap.java:257)
            at org.apache.tapestry.listener.ListenerMap.access$100(ListenerMap.java:46)
            at org.apache.tapestry.listener.ListenerMap$SyntheticListener.invoke(ListenerMap.java:97)
            at org.apache.tapestry.listener.ListenerMap$SyntheticListener.actionTriggered(ListenerMap.java:102)
            at org.apache.tapestry.form.ImageSubmit.renderComponent(ImageSubmit.java:110)
            at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
            at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:624)
            at org.apache.tapestry.components.RenderBody.renderComponent(RenderBody.java:45)
    ......

    ---------------------------------------------------------------------
    JIRA INFORMATION:
    This message is automatically generated by JIRA.

    If you think it was sent incorrectly contact one of the administrators:
       http://objectstyle.org/jira/secure/Administrators.jspa

    If you want more information on JIRA, or have a bug to report see:
       http://www.atlassian.com/software/jira



    This archive was generated by hypermail 2.0.0 : Wed Mar 23 2005 - 09:56:20 EST