Skip to content

Calls not removed from memory even after completing #2313

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

Closed
maria-farooq opened this issue Jul 3, 2017 · 2 comments
Closed

Calls not removed from memory even after completing #2313

maria-farooq opened this issue Jul 3, 2017 · 2 comments

Comments

@maria-farooq
Copy link

maria-farooq commented Jul 3, 2017

Problem
we recently found that RC was pilling up Call and MMSCallController actors in memory. we could see that Call was in stopping state and MMSCallController was in inactive state.

Root Cause

  • Calls were related to Recording here is what happens to them:
  • RC received BYE.
  • Call goes to Stopping state.
  • Call send msg to MMSCallController to clean MediaServer resources.
  • MMSCallController clean MS resources and give back proper response (INACTIVE).
  • Call moved to Completed state & DB was updated properly.
  • At VoiceInterpreter, RCML kicks in and sends Hangup to the call (please mind call was already completed)
  • upon receiving Hangup, Call moves from Completed to Stopping state AGAIN
  • and send msg to MMSCallController to clean MediaServer resources AGAIN. (please mind MMSCallControllerwas already INACTIVE)
  • MMSCallController has not defined action for this situation hence does nothing
  • Call keeps waiting for response from MMSCallController hence actor stays in memory forever.

Comments & Questions

  • If a Call is already Completed and we get a Hangup, should not we ignore it..
  • should a transition from Completed to Stopping state be allowed? wHy?

Reference:

@gvagenas
Copy link
Contributor

gvagenas commented Jul 5, 2017

When Call actor will receive BYE, will from Stopping to Complete state (after receive MmsCallController response) and will notify VoiceInterpreter for the new state.
When VoiceInterpreter receive the Completed state change, will:

  1. Ask Call actor to stop media group

  2. Will move to finishRecording

  3. Call actor will receive StopMediaGroup but will do nothing since the state is NOT if (is(inProgress) || is(waitingForAnswer)) {

  4. VI state finishRecording will wrapup the recording and will either stop the interpreter or get next verb.

There is a race condition at step 2 where VI might never proceed to the next step and hang there forever and that seems to be the issue here

@gvagenas
Copy link
Contributor

gvagenas commented Jul 5, 2017

When the race condition described at previous comment doesn't occur, VI gets End RCML tag and sends Hangup on the call as @maria-farooq describes in her comment
So actually 2 issues here

maria-farooq pushed a commit that referenced this issue Jul 10, 2017
* master:
  - Patch for Recording and Dial with record, race condition - Patch for DialStatusCallback to don't execute the same state more than once This close #2332 This close #2335
  Work in progress for issue #2332
  Modified test case to test child behavior on parent termination This refer to #2274
  TLS_CLIENT_AUTH_TYPE configuration option.
  Fixes #2328 - config-rvd.sh if/then/else syntax bug
  Merge Issue-2274 with origin/master
  Testsuite improvements
  added ActorSupervisorStrategyTest
  RestcommSupervisorStrategy.getStrategy()
  Patch to don't block call actor on Stopping state waiting for MmsCallController response This close #2261
  added ActorSupervisorStrategyTest
  trying blackhub copilot
  Integrating black duck software copilot for license check
  hangupOnEnd default value bugfix
  Patch for race condition for Calls that execute Record verb and receive a Bye from client. This close #2313
  Child actors should be created using getContext().actorOf() #2274
maria-farooq pushed a commit that referenced this issue Jul 12, 2017
* master: (37 commits)
  closed #2341
  - Patch for Recording and Dial with record, race condition - Patch for DialStatusCallback to don't execute the same state more than once This close #2332 This close #2335
  Work in progress for issue #2332
  Modified test case to test child behavior on parent termination This refer to #2274
  Configure 'rvdUrl' in dashboard.json from advanced.conf/RVD_URL
  TLS_CLIENT_AUTH_TYPE configuration option.
  Fixes #2328 - config-rvd.sh if/then/else syntax bug
  Merge Issue-2274 with origin/master
  Testsuite improvements
  added ActorSupervisorStrategyTest
  RestcommSupervisorStrategy.getStrategy()
  Patch to don't block call actor on Stopping state waiting for MmsCallController response This close #2261
  added ActorSupervisorStrategyTest
  trying blackhub copilot
  Integrating black duck software copilot for license check
  fixed #2319
  hangupOnEnd default value bugfix
  Patch for race condition for Calls that execute Record verb and receive a Bye from client. This close #2313
  added DTMF_DETECTOR_TONE_INTERVAL #2303
  added MEDIA_MAX_DURATION #2317
  ...

Conflicts resolved:
	restcomm/restcomm.monitoring.service/src/main/java/org/restcomm/connect/monitoringservice/MonitoringService.java
	restcomm/restcomm.mrb/src/main/java/org/restcomm/connect/mrb/MediaResourceBrokerGeneric.java
	restcomm/restcomm.sms/src/main/java/org/restcomm/connect/sms/SmsSession.java
	restcomm/restcomm.sms/src/main/java/org/restcomm/connect/sms/smpp/SmppMessageHandler.java
	restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/CallManager.java
	restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/ua/UserAgentManager.java
	restcomm/restcomm.ussd/src/main/java/org/restcomm/connect/ussd/telephony/UssdCallManager.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants