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
Calling jsonrpc_notification fail in failure route when fr_timer timeout #713
Comments
Can you paste here the patch to the solution you tried? |
Thanks for replying. Here it is. As I said this is not a good solution. --- jsonrpc_mod.c.orig
+++ jsonrpc_mod.c
@@ -120,7 +120,6 @@
{
int pid;
- if (rank>PROC_MAIN)
cmd_pipe = pipe_fds[1];
if (rank!=PROC_MAIN) |
miconda
added a commit
that referenced
this issue
Sep 12, 2016
- reported by Ian Yu-Hsun Lin, GH #713
Thanks, finally got back to this one after holidays season, pushing a slightly different patch to master branch (it will be backported). |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Kamailio 4.3.3
Ubuntu 14.04.1 x86_64
Problem
I'm using
t_suspend()
andt_continue()
for mobile push notification scenario. Before callingt_suspend()
I set thefr_timer
to 12 seconds andt_on_failure()
to my custom failure route (e.g.failure_route[MY_FAILURE_ROUTE]
). The scenario is fairly similar to [SR-Users] Timeout after t_suspend and failure route, the only difference is I try to usejsonrpc_notificaion()
to notify the user asynchronously in my custom failure route.There are 2 different results depending on how it goes to the failure route:
fr_timer
expiresjsonrpc_notification
can successfully be called in failure routefr_timer
did timeout after 12 secondsjsonrpc_notification
:jsonrpc_notification(): failed to write to io pipe: Bad file descriptor
Investigation
For the first case that perform normally, the IDs of Kamailio processes being used are the same for both calling t_suspend() and entering failure route, while in the second case the processes are different.
Following added some debug messages in Kamailio's
main.c
it showed that the process being used in the failure route of case 2 isslow timer process
, and fromjsonrpc_mod.c
'schild_init()
function, the rank ofslow timer process
is -1 therefore it doesn't assign thefd
to this process.My workaround was just assigning the
fd
to each child duringchild_init()
injsonrpc_mod.c
but that's definitely not a good way to go. I am appreciated if you can give me some advice to solve this problem correctly.Cheers,
Ian
The text was updated successfully, but these errors were encountered: