[ 
https://issues.apache.org/activemq/browse/SM-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43894#action_43894
 ] 

Guillaume Nodet commented on SM-512:
------------------------------------

I've run a small test, and this use case it not really handled well. So I'd 
agree there is a bug.
I'm not sure what's the way to solve this yet, but the problem is that i end up 
with the following stack trace: 

[EMAIL PROTECTED], priority=5, in group 'main', status: 'RUNNING'
          at org.apache.servicemix.jbi.nmr.flow.st.STFlow.doSend(STFlow.java:50)
          at 
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.send(AbstractFlow.java:123)
          at 
org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:283)
          at 
org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:843)
          at 
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:395)
          at 
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:470)
          at 
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
          at 
org.apache.servicemix.components.util.PojoSupport.sendSync(PojoSupport.java:208)
          at 
org.apache.servicemix.jbi.messaging.MEPExchangeTest$TestComponent.onMessageExchange(MEPExchangeTest.java:71)
          at 
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
          at 
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
          at org.apache.servicemix.jbi.nmr.flow.st.STFlow.doSend(STFlow.java:49)
          at 
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.send(AbstractFlow.java:123)
          at 
org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:283)
          at 
org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:843)
          at 
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:395)
          at 
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:470)
          at 
org.apache.servicemix.jbi.messaging.MEPExchangeTest.testInOutSyncSync(MEPExchangeTest.java:367)
          at 
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
          at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at junit.framework.TestCase.runTest(TestCase.java:154)
          at junit.framework.TestCase.runBare(TestCase.java:127)
          at junit.framework.TestResult$1.protect(TestResult.java:106)
          at junit.framework.TestResult.runProtected(TestResult.java:124)
          at junit.framework.TestResult.run(TestResult.java:109)
          at junit.framework.TestCase.run(TestCase.java:118)
          at junit.textui.TestRunner.doRun(TestRunner.java:116)
          at 
com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:65)
          at junit.textui.TestRunner.doRun(TestRunner.java:109)
          at 
com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
          at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
          at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)

At the top of the thread, the processInbound method is called, but the checks 
are wrong and instead of deliverying the exchange, the lock at the bottom of 
the stack trace is notified, but not the one from the second sendSync.   It's 
not even a deadlock, it's more than the right lock is never notified.
So yeah, there is a missing SYNC_STATE_SYNC_RECEIVED i suppose, but also, the 
DONE status has to be delivered somehow.
The test I used it to use the ST flow with a provider component implementing 
MessageExchangeListener and using sendSync on both sides: this leads to the 
super-synchronous use case ...

> sendsync from a service to another service seems to cause a deadlock under 
> load
> -------------------------------------------------------------------------------
>
>                 Key: SM-512
>                 URL: https://issues.apache.org/activemq/browse/SM-512
>             Project: ServiceMix
>          Issue Type: Bug
>    Affects Versions: 3.0-M2
>         Environment: Windows 2003, Intel 2.8 xeon processor. Java 1.5 3.0-M2
>            Reporter: anand somani
>            Assignee: Guillaume Nodet
>             Fix For: 3.0
>
>         Attachments: test.zip
>
>
> We have 2 services A and B. A makes sync requests to B. We have a JMS client 
> that feeds requests to A and that triggers a sync request to B. We are trying 
> to push some 5000 requests (not sequential). Now
>      With st flow - A gets all the responses from B and we are good
>      with Seda flow -  A gets some responses from B (sometimes none) and then 
> all the threads are blocked (seen using JMX) on syncsend(), looks like B has 
> no threads to service requests.
>      with JMS flow ( A and B on different VMs), we see the similar behavior 
> as with seda flow
> With async requests everything works just fine. We have tried increasing seda 
> capacity and workmanager thread count, that did not help.  I am attaching 
> service A and B code along with configuration files
> Also it would be nice to have all the tunable features documented with some 
> explaination somewhere ( I could not find it anywhere)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to