Login Form






Lost Password?
No account yet? Register
Home arrow Forums
ECharts
Welcome, Guest
Re:Problem with B2buaSafeFsm (0 viewing) 
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Problem with B2buaSafeFsm
#408
Hauke D (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Problem with B2buaSafeFsm 6 Months ago  
Hello everyone,

We're having a problem with the B2buaSafeFsm, or rather TransparentHandleRequestFSM, when used on SailFin. It seems that the transitions are not robust enough in the case of exceptions, which SailFin likes to throw.

SailFin likes to be very strict about session states, and it throws IllegalStateExceptions when trying to send messages and the sessions are not in just the right states. One case where this is happening is when the B2buaSafeFsm is used to _link_ two call legs, and a BYE is received on the second call leg while the first has not received an ACK yet (i.e. between the 200 OK for the INVITE and the ACK). The exceptions that occur in this case are below.

So far I have been able to identify the source of the first exception, it seems to be the transition from INIT to REQUEST_RELAYED in TransparentHandleRequestFSM, where attempting to send the request is causing an exception because the session has already been terminated by the BYE (I think - I'm still investigating).

I've encountered this problem with SailFin before, and at the moment it seems like it might be easier to just handle this case in the FSM.

I'm thinking that a solution might be to add an exception handler, but since I'm not an ECharts expert (we were hoping to just use the B2buaSafeFsm as-is), I'm not sure if this is a good solution. Any thoughts would be greatly appreciated.

Thanks,
-- Hauke D




BOX_REGION: TERMINATING
EXCEPTION: java.lang.IllegalStateException
FINAL_MACHINE_STATE: :org.echarts.servlet.sip.FeatureBoxTerminationHandlerFSM{ RUN_APPLICATION:test.B2BUserAgent{ IN_CALL:org.echarts.servlet.sip.machines.B2buaSafeFSM{ ACTIVE{ INITIAL_INVITE:org.echarts.servlet.sip.machines.B2buaInviteFSM{ SUCCESS } TRANSPARENT:org.echarts.servlet.sip.machines.TransparentFSM{ TRANSPARENT[0]:org.echarts.servlet.sip.machines.TransparentHandleRequestFSM{ WAIT_FOR_ACK } TRANSPARENT[1]:org.echarts.servlet.sip.machines.TransparentHandleRequestFSM{ INIT } } } } } }
MESSAGE: Encountered exception advancing box machine state
STACK_TRACE: java.lang.IllegalStateException
at com.ericsson.ssa.sip.INVITESession.doRequestUAC(INVITESession.java:433)
at com.ericsson.ssa.sip.INVITESession.send(INVITESession.java:448)
at com.ericsson.ssa.sip.UA.send(UA.java:510)
at com.ericsson.ssa.sip.SipServletRequestImpl.send(SipServletRequestImpl.java:994)
at org.echarts.servlet.sip.SipPort.output(SipPort.java:744)
at org.echarts.servlet.sip.machines.TransparentHandleRequestFSM.transition_1_1_action(TransparentHandleRequestFSM.java:130)
at org.echarts.servlet.sip.machines.TransparentHandleRequestFSM$2.invoke(TransparentHandleRequestFSM.java:46)
at org.echarts.BasicTransitionTarget.evaluateAction(BasicTransitionTarget.java:63)
at org.echarts.TransitionMachine.fireMessagelessTransition(TransitionMachine.java:1249)
at org.echarts.TransitionMachine.runMessagelessTransitionSequence(TransitionMachine.java:1204)
at org.echarts.TransitionMachine.runMessageTransitionSequence(TransitionMachine.java:1187)
at org.echarts.TransitionMachine.run(TransitionMachine.java:1056)
at org.echarts.servlet.sip.BoxMachineRunner.advanceBoxMachine(BoxMachineRunner.java:77)
at org.echarts.servlet.sip.SipPort.input(SipPort.java:786)
at org.echarts.servlet.sip.EChartsSipServlet.dispatchToFreeBox(EChartsSipServlet.java:471)
at org.echarts.servlet.sip.EChartsSipServlet.doRequest(EChartsSipServlet.java:396)
at javax.servlet.sip.SipServlet.service(SipServlet.java:46)
at com.ericsson.ssa.container.sim.SipServletFacade.service(SipServletFacade.java:121)
at com.ericsson.ssa.sip.INVITESession.dispatch(INVITESession.java:1376)
at com.ericsson.ssa.sip.UA.dispatch(UA.java:657)
at com.ericsson.ssa.container.sim.ApplicationDispatcher.dispatchViaStatelessProxy(ApplicationDispatcher.java:638)
at com.ericsson.ssa.container.sim.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:178)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:53)
at com.ericsson.ssa.container.sim.ApplicationDispatcher.next(ApplicationDispatcher.java:697)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.sip.LocalRouteManager.next(LocalRouteManager.java:98)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.sip.DialogManager.next(DialogManager.java:568)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.sip.dns.ResolverManager.next(ResolverManager.java:169)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.sip.persistence.ReplicationManager.next(ReplicationManager.java:102)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.sip.transaction.TransactionManager.invokeCreatedOrFetchedServerTransaction(TransactionManager.java:238)
at com.ericsson.ssa.sip.transaction.TransactionManager.next(TransactionManager.java:291)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.container.OutboundFlowManager.processOutboundRequest(OutboundFlowManager.java:183)
at com.ericsson.ssa.container.OutboundFlowManager.next(OutboundFlowManager.java:98)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.container.GrizzlyNetworkManager.next(GrizzlyNetworkManager.java:1331)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.container.MessageProcessorFilter.processMessage(MessageProcessorFilter.java:416)
at com.ericsson.ssa.container.MessageProcessorFilter.execute(MessageProcessorFilter.java:303)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:136)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
at com.ericsson.ssa.container.GrizzlyNetworkManager$SharedCallbackHandler.onRead(GrizzlyNetworkManager.java:3136)
at com.sun.grizzly.CallbackHandlerContextTask.doCall(CallbackHandlerContextTask.java:76)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)




BOX_REGION: TERMINATING
EXCEPTION: java.lang.IllegalStateException
MESSAGE: Exception encountered tearing down SipPort: caller
STACK_TRACE: java.lang.IllegalStateException
at com.ericsson.ssa.sip.INVITESession.doRequestUAC(INVITESession.java:433)
at com.ericsson.ssa.sip.INVITESession.send(INVITESession.java:448)
at com.ericsson.ssa.sip.UA.send(UA.java:510)
at com.ericsson.ssa.sip.SipServletRequestImpl.send(SipServletRequestImpl.java:994)
at org.echarts.servlet.sip.SipPort.output(SipPort.java:744)
at org.echarts.servlet.sip.SipPortTeardownFSM.transition_5_1_action(SipPortTeardownFSM.java:156)
at org.echarts.servlet.sip.SipPortTeardownFSM$9.invoke(SipPortTeardownFSM.java:47)
at org.echarts.BasicTransitionTarget.evaluateAction(BasicTransitionTarget.java:63)
at org.echarts.TransitionMachine.fireMessagelessTransition(TransitionMachine.java:1249)
at org.echarts.TransitionMachine.runMessagelessTransitionSequence(TransitionMachine.java:1204)
at org.echarts.TransitionMachine.initializeRoot(TransitionMachine.java:1170)
at org.echarts.servlet.sip.FeatureBox.terminate(FeatureBox.java:304)
at org.echarts.servlet.sip.BoxMachineRunner.advanceBoxMachine(BoxMachineRunner.java:97)
at org.echarts.servlet.sip.SipPort.input(SipPort.java:786)
at org.echarts.servlet.sip.EChartsSipServlet.dispatchToFreeBox(EChartsSipServlet.java:471)
at org.echarts.servlet.sip.EChartsSipServlet.doRequest(EChartsSipServlet.java:396)
at javax.servlet.sip.SipServlet.service(SipServlet.java:46)
at com.ericsson.ssa.container.sim.SipServletFacade.service(SipServletFacade.java:121)
at com.ericsson.ssa.sip.INVITESession.dispatch(INVITESession.java:1376)
at com.ericsson.ssa.sip.UA.dispatch(UA.java:657)
at com.ericsson.ssa.container.sim.ApplicationDispatcher.dispatchViaStatelessProxy(ApplicationDispatcher.java:638)
at com.ericsson.ssa.container.sim.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:178)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:53)
at com.ericsson.ssa.container.sim.ApplicationDispatcher.next(ApplicationDispatcher.java:697)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.sip.LocalRouteManager.next(LocalRouteManager.java:98)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.sip.DialogManager.next(DialogManager.java:568)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.sip.dns.ResolverManager.next(ResolverManager.java:169)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.sip.persistence.ReplicationManager.next(ReplicationManager.java:102)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.sip.transaction.TransactionManager.invokeCreatedOrFetchedServerTransaction(TransactionManager.java:238)
at com.ericsson.ssa.sip.transaction.TransactionManager.next(TransactionManager.java:291)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.container.OutboundFlowManager.processOutboundRequest(OutboundFlowManager.java:183)
at com.ericsson.ssa.container.OutboundFlowManager.next(OutboundFlowManager.java:98)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.container.GrizzlyNetworkManager.next(GrizzlyNetworkManager.java:1331)
at com.ericsson.ssa.sip._layer_Helper.next(_layer_Helper.java:60)
at com.ericsson.ssa.container.MessageProcessorFilter.processMessage(MessageProcessorFilter.java:416)
at com.ericsson.ssa.container.MessageProcessorFilter.execute(MessageProcessorFilter.java:303)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:136)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
at com.ericsson.ssa.container.GrizzlyNetworkManager$SharedCallbackHandler.onRead(GrizzlyNetworkManager.java:3136)
at com.sun.grizzly.CallbackHandlerContextTask.doCall(CallbackHandlerContextTask.java:76)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#410
Tom Smith (Admin)
Admin
Posts: 70
graphgraph
User Offline Click here to see the profile of this user
Re:Problem with B2buaSafeFsm 6 Months ago  
Hauke:

Our goal is to have B2buaSafeFSM handle cases like this without Exceptions. Let us try to replicate the problem and let you know what we find.

Thanks,
Tom.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#418
Eric Cheung (Admin)
Admin
Posts: 24
graphgraph
User Offline Click here to see the profile of this user
Re:Problem with B2buaSafeFsm 6 Months ago  
It seems that SailFin is throwing an exception when the b2bua has sent 200 OK response to INVITE but has not received ACK yet on the first call leg, then the b2bua receives BYE from the second leg and attempts to send the BYE to the first leg. I believe this should be allowed by the container, i.e. this would be a SailFin bug.

While it is easy to catch this exception in the FSM, it is not clear how the exception should be handled. For example, should it then wait for the ACK to arrive before sending it again? I think this comes back to what Tom said about the FSM should handle the case without exceptions. Perhaps we need to customize the FSMs to accommodate this SailFin behavior.

I am working on reproducing this exception with a KitCAT test case and will post back. What SailFin version are you using?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#420
Hauke D (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Re:Problem with B2buaSafeFsm 6 Months ago  
Hi Tom, Hi Eric,

Thanks very much for the quick replies and for taking a look at this.

We're using the 2.0 release version of SailFin.

Eric, I think your analysis is correct; I've attached a call flow that I've created from a Wireshark capture below. UA 1 does have a slight delay (approx. 5 seconds) before it sends the ACK to the Re-INVITE - normally not a problem.

I've seen this kind of problem with SailFin before and have reported it, but it has always seemed to be a low-priority issue for the SailFin guys because adding an exception handler is usually the easier solution.

I'm not sure of the best solution either, but I think that sending the BYE should have a higher priority, so it does sound like it might be necessary for the FSM to wait in case of an exception...

Thanks,
-- Hauke D

Code: :

  _____ UA 1 __________ B2BUA __________ UA 2 _____         |               |                |                |---INVITE----->|                |                |               |---INVITE------>|                |               |                |                |               |<--180----------|                |<--180---------|                |                |               |                |                |               |<--200----------|                |<--200---------|                |                |               |                |                |---ACK-------->|                |                |---INVITE----->|                |                |               |---ACK--------->|                |               |---INVITE------>|                |               |                |                |               |<--200----------|                |<--200---------|                |                |               |                |                |               |<--200----------|                |<--200---------|                |                |               |                |                |               |<--BYE----------|                |               |---200(BYE)---->|                |               |                |                |<--200---------|                |                |               |                |                |<--200---------|                |                |               |                |                |---ACK-------->|                |                |               |                |                |---INVITE----->|                |                |<--481---------|                |                |---ACK-------->|                |                |               |                |                |---BYE-------->|                |                |<--481---------|                |                |               |                |       

 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#421
Tom Smith (Admin)
Admin
Posts: 70
graphgraph
User Offline Click here to see the profile of this user
Re:Problem with B2buaSafeFsm 6 Months ago  
Do you know if there is a Sailfin bug filed for the issue, and if so, what the number is?

Thanks,
Tom.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#423
Hauke D (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Re:Problem with B2buaSafeFsm 6 Months ago  
Hi,

I'm not sure anymore if I've reported this exact issue (it's been a while) - to correct what I said earlier, I've definitely seen similar problems with session states before, and have reported those. Here are the _link_s to these kind of issues that I've run into:

Issue 1805
Issue 2018
Forum post

Thanks,
-- Hauke D
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop
Copyright © 2006-2009 echarts.org