<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">All long running non js code should be wrapped in the suspend/resume gc stuff. For example:<div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><span class="Apple-tab-span" style="white-space:pre">        </span>cb_state.ret = BOOLEAN_TO_JSVAL(JS_FALSE);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><span class="Apple-tab-span" style="white-space:pre">        </span>cb_state.saveDepth = JS_SuspendRequest(cx);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><span class="Apple-tab-span" style="white-space:pre">        </span>args.input_callback = dtmf_func;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><span class="Apple-tab-span" style="white-space:pre">        </span>args.buf = bp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><span class="Apple-tab-span" style="white-space:pre">        </span>args.buflen = len;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><span class="Apple-tab-span" style="white-space:pre">        </span>switch_ivr_sleep(jss->session, ms, sync, &args);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><span class="Apple-tab-span" style="white-space:pre">        </span>JS_ResumeRequest(cx, cb_state.saveDepth);</div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">I think this is your issue. Can you please file a bug on jira for this issue (even better with a patch) </span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">Mike</span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><br></div><div><br><div><div>On Jan 16, 2009, at 5:54 AM, Jonas Gauffin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div>I've found the problem. one js thread wait in socket.read (mod_spidermonkey_socket) on data. </div><div>That caller have hangup, which means that the garbage collector waits on it to close.<br></div><div><br> </div><div>All new javascript sessions waits in JS_AWAIT_GC_DONE for the garbage collector to be done before proceeding (which means that all new javascript calls don't do anything after being launched).</div><div><br> </div><div>My server will not send anything until an agent gets free or the session hangs up (detects it through the event socket). And the event socket will not send that the session has been hangup until the socket have received anything (and the script can exit). So it's kind of deadlock between my server and the spidermonkey_socket. </div> <div><br></div><div>Is it possible to add an option to socket.read to make it abort if the session have been closed? I know that I wrote mod_spidermonkey_socket from the start, but I can't figure out how to do it.</div> <div><br></div><div>Will new sessions always wait on old ones to be garbage collected properly? For instance, what happens if a script have a lenghty post process after caller have hang up? </div><div><br></div><div class="gmail_quote"> On Fri, Jan 16, 2009 at 9:38 AM, Jonas Gauffin <span dir="ltr"><<a href="mailto:jonas.gauffin@gmail.com">jonas.gauffin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> I've got a loop, but the first thing checked in each iteration is if session.ready() returns false (and in that case exit the loop).<div><br></div><div>I do create sessions in the script: create, try to originate to a destination and then finally bridge together the caller and the new session.</div> <div><br></div><div>I'll try to give you more details during the day.</div><div><div></div><div class="Wj3C7c"><div><br><div class="gmail_quote">On Fri, Jan 16, 2009 at 12:48 AM, Anthony Minessale <span dir="ltr"><<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>></span> wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">do you have any loops in your code that might not check for session.ready() in a exit when its not true.<br><br>The symptoms you posted would be consistent with held readlocks so if you got a gcore (or windows equiv) of the process you might be able to see what threads where doing what to hang on to the read lock.<br> <br>also are you creating sessions in the script then executing app with them, beware of this because the thread of the script is used to execute apps on a session created that way and not the session thread.<br><br><br> <br> <br><div class="gmail_quote"><div><div></div><div>On Thu, Jan 15, 2009 at 5:20 AM, Jonas Gauffin <span dir="ltr"><<a href="mailto:jonas.gauffin@gmail.com" target="_blank">jonas.gauffin@gmail.com</a>></span> wrote:<br> </div></div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div><div></div><div> Hello<div><br></div><div>I got problems with hanging spidermonkey sessions and need some advice on how to debug them.</div><div><br></div><div>I've made a javascript queue application that uses mod_spidermonkey_socket. It works fine for a while,</div> <div>but after some calls I noticed that calls didnt get transferred to agents. The reason was that earlier</div><div>calls had not been terminated properly.</div><div><br></div><div><div>freeswitch@test1> hupall</div> <div>2009-01-15 12:15:04 [CRIT] switch_core_session.c:147 switch_core_session_hupall() Giving up with 8 sessions remaining</div><div>API CALL [hupall()] output:</div><div>+OK hangup all channels with cause MANAGER_REQUEST</div> <div><br></div><div><br></div><div>freeswitch@test1> show calls</div><div>API CALL [show(calls)] output:</div><div><br></div><div>0 total.</div><div><br></div><div><br></div><div>As you can see, 8 sessions are alive, but none of them are listed as calls. What kind of logs should I turn on to see what is happening with those sessions?</div> <div><br></div><div>Thanks,</div><div> Jonas</div></div> <br></div></div><div>_______________________________________________<br> Freeswitch-users mailing list<br> <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> <br></div></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br> <br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br> IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br> <a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br> <a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br> <br>_______________________________________________<br> Freeswitch-users mailing list<br> <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> <br></blockquote></div><br></div> </div></div></blockquote></div><br></div> _______________________________________________<br>Freeswitch-users mailing list<br><a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br>http://www.freeswitch.org<br></blockquote></div><br></div></div></body></html>