-
Notifications
You must be signed in to change notification settings - Fork 392
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
Improvements to <exec> function #423
base: master
Are you sure you want to change the base?
Conversation
Added 'exec verify' to wait for a return code and verify it
d4e2a60
to
aa52c00
Compare
@rkday : something you want to review? This may need some docs, as documenting in code isn't enough if we want people to find it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dolk13 , thanks for this!
As Walter says, the docs need an update to mention verify
:
- https://github.com/SIPp/sipp/blob/master/docs/scenarios/actions.rst#external-commands
- and a DTD update at https://github.com/SIPp/sipp/blob/master/sipp.dtd#L102
Probably the key thing to mention as a difference between exec command
and exec verify
is that the latter is synchronous rather than asynchronous - SIPp will wait for the verified command to run before proceeding, and nothing can happen (no SIP messages can be handled, new calls set up, etc.) while it is running.
That makes me somewhat nervous, because I think this implementation is only suitable for very low loads (or very fast commands) - I ran a scenario with a verify-command that took 200ms to run, and despite me requesting a call setup rate of 10/sec it only actually achieved 2.7/sec.
I think a better approach would be:
- don't call waitpid() in call.cpp
- instead, pause the call (task.cpp has a setPaused method) and add a pointer to the call to a std::map keyed off the PID
- at the start of each iteration in traffic_thread in sipp.cpp, call waitpid with the WNOHANG option and a PID of -1, to check of any child process has exited
- if it has, unpause the call associated with it, and verify the return code
But I think I'd be OK to accept this without this change as long as the impact on the call rate was clearly documented, and improve performance in future.
} | ||
} | ||
break; | ||
} | ||
} else if (currentAction->getActionType() == CAction::E_AT_EXEC_INTCMD) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not still need this INTCMD section?
I added only 'exec verify'.
Improving output tracing brings a lot of changes. I will try to do PR later.
resolve #7