deadlock between commit and external event

From: chrisd (chris..xtelecom.com)
Date: Wed Mar 23 2005 - 08:53:24 EST

  • Next message: Andrus Adamchik: "Re: deadlock between commit and external event"

    Hi there,

    I have a database frontend webapp and a couple of other simpler java
    programs which feed info into the database and I've used jgroups to tie
    the cayenne instances together; I'm using cayenne version 1.1RC3.

    I am getting a nasty deadlock in the cayenne event processing code which
    is caused by commitChanges resulting in first the DataRowStore mutex
    being locked, then the DispatchQueue.

    At the same time, I might get an external event which first locks the
    DispatchQueue, then the DataRowStore.

    Stack traces of the two deadlocked threads should be attached.

    Has anyone else seen anything like this?

    Chris Dawes.


    "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)
            at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
            at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:624)
            at org.apache.tapestry.components.Any.renderComponent(Any.java:53)
            at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
            at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:624)
            at org.apache.tapestry.components.Foreach.renderComponent(Foreach.java:122)
            at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
            at org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:118)
            at com.wapmx.monitoring.admin.components.Rows.renderComponent(Rows.java:28)
            at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
            at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:624)
            at org.apache.tapestry.form.Form.renderComponent(Form.java:362)
            at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
            at org.apache.tapestry.form.Form.rewind(Form.java:568)
            at org.apache.tapestry.engine.RequestCycle.rewindForm(RequestCycle.java:432)
            at org.apache.tapestry.form.Form.trigger(Form.java:582)
            at org.apache.tapestry.engine.DirectService.service(DirectService.java:169)
            at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:872)
    ...



    This archive was generated by hypermail 2.0.0 : Wed Mar 23 2005 - 08:51:23 EST