[asterisk-bugs] [Asterisk 0017742]: [patch] ast_sched_runq runs to much events if one event runs too long

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Aug 10 13:05:39 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17742 
====================================================================== 
Reported By:                schmidts
Assigned To:                russell
====================================================================== 
Project:                    Asterisk
Issue ID:                   17742
Category:                   Core/General
Reproducibility:            sometimes
Severity:                   minor
Priority:                   normal
Status:                     closed
Asterisk Version:           1.6.2.10 
JIRA:                       SWP-1976 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2010-07-28 16:57 CDT
Last Modified:              2010-08-10 13:05 CDT
====================================================================== 
Summary:                    [patch] ast_sched_runq runs to much events if one
event runs too long
Description: 
same in 1.8.0
after debugging and tracing the new heap schedule concept i´ve found
something iam not sure about if this works like expacted.
in sched.c in the ast_sched_runq there is a for loop which takes the next
event from the heap and calculate the time which is 1 ms in future make a
time compare if this event is between now and the calculated time. if not
it breaks and get back to do_monitor. 
If it founds an event it start the callback and release this event then
take the next event and does the time calc and compare again.
if the callback of the curent event tooks to much time, or there are too
many events the time compare could get events which allready 1 ms further
away than expacted. 
they have been 2 ms or more away at the start time of runq.
====================================================================== 

---------------------------------------------------------------------- 
 (0125772) svnbot (reporter) - 2010-08-10 13:05
 https://issues.asterisk.org/view.php?id=17742#c125772 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 281576

_U  trunk/
U   trunk/main/sched.c

------------------------------------------------------------------------
r281576 | russell | 2010-08-10 13:05:38 -0500 (Tue, 10 Aug 2010) | 23
lines

Merged revisions 281575 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r281575 | russell | 2010-08-10 13:05:07 -0500 (Tue, 10 Aug 2010) | 16
lines
  
  Merged revisions 281574 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r281574 | russell | 2010-08-10 13:04:32 -0500 (Tue, 10 Aug 2010) | 9
lines
    
    Don't move the time threshold for running scheduled events on every
iteration.
    
    Instead, only calculate the time threshold each time ast_sched_runq()
is called.
    
    (closes issue https://issues.asterisk.org/view.php?id=17742)
    Reported by: schmidts
    Patches:
          sched.c.patch uploaded by schmidts (license 1077)
  ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=281576 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-08-10 13:05 svnbot         Checkin                                      
2010-08-10 13:05 svnbot         Note Added: 0125772                          
======================================================================




More information about the asterisk-bugs mailing list