synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prasad Jeewantha <jeewamp....@gmail.com>
Subject Re: How does fault handling work in synapse?
Date Tue, 18 Jun 2013 06:17:40 GMT
Hi,

Created an issue[1] on Jira and added a patch for version 2.2.0-SNAPSHOT.
[1] https://issues.apache.org/jira/browse/SYNAPSE-933

Jeewantha



On Fri, May 31, 2013 at 4:59 PM, Prasad Jeewantha <jeewamp.dev@gmail.com>wrote:

> Hi All,
>
> There is an issue in synapse which Im trying to solve where I get an
> EmptyStackException when running this sample
> http://synapse.apache.org/Synapse_Samples.html#Sample57.
>
> Here is the stacktrace.
>
> java.util.EmptyStackException
>     at java.util.Stack.peek(Stack.java:85)
>     at java.util.Stack.pop(Stack.java:67)
>     at
> org.apache.synapse.endpoints.DynamicLoadbalanceEndpoint$DynamicLoadbalanceFaultHandlerImpl.onFault(DynamicLoadbalanceEndpoint.java:506)
>     at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:54)
>     at
> org.apache.synapse.endpoints.AbstractEndpoint.invokeNextFaultHandler(AbstractEndpoint.java:618)
>     at
> org.apache.synapse.endpoints.AbstractEndpoint.onFault(AbstractEndpoint.java:467)
>     at
> org.apache.synapse.endpoints.AddressEndpoint.onFault(AddressEndpoint.java:43)
>     at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:102)
>     at
> org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:243)
>     at
> org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:166)
>     at
> org.apache.synapse.transport.passthru.TargetErrorHandler$1.run(TargetErrorHandler.java:132)
>     at
> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>     at java.lang.Thread.run(Thread.java:662)
>
> What I saw while debugging was that when an endpoint *send(Msgctx)*method is invoked,
a fault handler is pushed to a stack in MessageContext.
> When the message goes to another endpoint, another fault handler will be
> pushed to the stack in the *send(Msgctx) *method of the second endpoint.
> But as far as I figured out, the fault handlers are poped from the stack
> only when a fault occurs, i.e. in the *onFalut()* method of a fault
> handler.
>
> My question is, should'nt we pop a fault handler from the stack, when the
> message goes out from an endpoint? Otherwise how do we figure out which
> fault handler in the stack belongs to which endpoint?
>
> It would be great if someone can explain me briefly the architecture of
> fault hanlding in synapse. Any help is appreciated.
>
> Thanks,
> PJ
>
>
>
>
>
>

Mime
View raw message