Changes between Initial Version and Version 3 of Ticket #2176


Ignore:
Timestamp:
Feb 13, 2019 6:55:12 AM (5 years ago)
Author:
nanang
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2176

    • Property Status changed from new to closed
    • Property Resolution changed from to fixed
  • Ticket #2176 – Description

    initial v3  
    11There have been some reports about crash in timer heap (there was #2172, but reported that crash still occurs even after integrating the patch). Creating a stress test for timer heap to reproduce the issue could be useful in identifying the problem and verifying a future solution. 
     2 
     3=== Few notes after running the stress test === 
     4 - The stress test could reproduce the previously suspected issue of "pop_freelist()+push_freelist() after remove_node() in pj_timer_heap_poll()", here is a bit more description on it: 
     5 
     6   {{{pop_freelist()}}} will only preserve the {{{timer_id}}}, not the timer entry as the timer entry node has been completely detached from the heap. it may cause crash, as the number of free {{{timer_id}}} is less than timer heap slot, e.g: if the app has 4 timer polling threads, there can be 4 less free {{{timer_id}}} than timer heap slot, while the timer heap slot will grow only when there are 2 free timer heap slot left. 
     7 
     8 So r5934 removes {{{pop_freelist() + push_freelist()}}} after {{{remove_node()}}}. 
     9 
     10 - The issue described in #2172 (double destroy after cancel_timer() return code not checked) could not be reproduced, but later after a further investigation, found out that it may actually be a false alarm because the poll() sets timer entry group lock to NULL (within the same timer lock block as remove_node()) before invoking callback, so it should be safe from the double destroy issue.