-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
M3UA State Machine (FSM) states race during stack stop #308
Comments
A similar problem is occurred in a real world scenario:
AS name=stp_1001_as functionality=IPSP mode=SE ipspType=CLIENT trMode=2 defaultTrMode=2 peerFSMState=INACTIVE
ASP name=stp_1001_asp3 aspid=4 heartbeat=false sctpAssoc=stp_1001_assoc3 started=true ASP name=stp_1001_asp4 aspid=5 heartbeat=false sctpAssoc=stp_1001_assoc4 started=true |
Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug
What happened:
When stopping M3UA stack on CLIENT side (Functionality = IPSP, ExchangeType = SE, IPSPType = CLIENT) the following error appears in application logs:
After some research it has been discovered that when stopping M3UA stack on CLIENT side using
M3UAManagementImpl#stop()
the problem described below arises duringAspFactory
stop after ASP Down message is sent to switch device (in our case, simulator running locally)jss7/m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/AspFactoryImpl.java
Lines 215 to 218 in 402b4b3
If ASP Down Ack response message from switch device (simulator) arrives before local FSM is moved to state
AspState.DOWN_SENT
using signalTransitionState.ASP_DOWN_SENT
(it happens just after ASP Down message sending) in the following codejss7/m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/AspFactoryImpl.java
Lines 218 to 224 in 402b4b3
then
UnknownTransitionException
occures due to trying to signalTransitionState.ASP_DOWN_ACK
(move local FSM toAspState.DOWN
state) in the following codejss7/m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/AspStateMaintenanceHandler.java
Lines 277 to 281 in 402b4b3
while local FSM is still in
AspState.ACTIVE
state (TransitionState.ASP_DOWN_ACK
transition expects that local FSM is already inAspState.DOWN_SENT
state).So, there is a race between FSM states due to expecting that after ASP Down message sent local FSM will be moved to
AspState.DOWN_SENT
before ASP Down Ack message arived.How to reproduce it (as minimally and precisely as possible):
The simplest way to reproduce the problem is to create a synthetic delay after code line below:
jss7/m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/AspFactoryImpl.java
Line 218 in 402b4b3
either by adding something like
Thread.sleep(...)
or just stopping at the next code line in a debug mode.Anything else we need to know?:
Just to repeat - the problem has been arised with running locally simulator (thanks to this, it was possible to create such a small delay between ASP Down sent and ASP Down Ack arrived).
Environment:
The text was updated successfully, but these errors were encountered: