[asterisk-dev] iax2_sched_replace: Unable to cancel schedule

Timo Teräs timo.teras at iki.fi
Fri May 2 00:07:39 CDT 2008


Timo Teräs wrote:
> I'm getting log messages such as:
> 
> [Apr 30 11:29:48] WARNING[15015]: chan_iax2.c:1103 iax2_sched_replace: Unable to cancel schedule ID 8973.  This is probably a bug (chan_iax2.c: iax2_sched_replace, line 1103).
> [Apr 30 11:29:55] WARNING[15015]: chan_iax2.c:1103 iax2_sched_replace: Unable to cancel schedule ID 9336.  This is probably a bug (chan_iax2.c: iax2_sched_replace, line 1103).
> [Apr 30 11:29:56] WARNING[15015]: chan_iax2.c:1103 iax2_sched_replace: Unable to cancel schedule ID 9487.  This is probably a bug (chan_iax2.c: iax2_sched_replace, line 1103).
> 
> on Asterisk 1.6.0-beta8 (with connectedline patches).
> 
> Any suggestions how to debug those?

Ok. I think I got it. I get these on a slow machine. So I think the problem is the usage of AST_SCHED_REPLACE() in iax2_sched_replace(). Looking at the comments in sched.h ASC_SCHED_REPLACE() should be used only for entities where the scheduler callback returns non-zero to get injected back to scheduler queue with same id. It looks like to me that all scheduler callbacks return zero so usage of this macro is incorrect (the macro assumes that the ID is always valid; and if it's not then the scheduler callback is being run in another thread and reinjected soon; so it loops a couple of times trying to delete it again). Doing s/AST_SCHED_REPLACE/ast_sched_replace/ in chan_iax2.c cured the problem for me. Now I'm wondering why ast_sched_replace is marked deprecated in sched.h? Clearly it has valid usages where AST_SCHED_REPLACE is not appropriate.

Cheers,
  Timo



More information about the asterisk-dev mailing list