This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 192427 - Insufficient synchronization in TimableEventQueue
Summary: Insufficient synchronization in TimableEventQueue
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.0
Hardware: PC Windows XP
: P1 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
: 192968 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-11-24 18:21 UTC by fvogler
Modified: 2010-12-07 12:59 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Fix synchronization in TimableEventQueue (1.32 KB, patch)
2010-11-24 18:23 UTC, fvogler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description fvogler 2010-11-24 18:21:17 UTC
Hi,

from time to time it seems that the TimableEventQueue enters an "illegal" state
and logs a warning "Still previous controller ..." (Line 188).

Cause:
1) "Watch Dog" task is scheduled by call to method "tick" (start time set)

2) Method "done" is called and finished, but canceling the task has failed.
   -> Task just starts running (removed from queue), but "run" method is not
      entered yet. Variable "stoppable" is not set yet.
   -> variable "stoppable" is reseted to "null" by "done" method

3) Task enters "run" method, starts self sampling and sets variable
   "stoppable" = this

4) Task is scheduled again by call to method "tick" (start time reseted)

5) Task enters "run" method, but variable "stoppable" is not "null"
   (it is still set to "previous" task)
   -> Log: Warning: "Still previous controller ..."
   -> (previous) self sampling still running

6) Method "done" is called after second event has been dispatched.
   -> if fast dispatch (time <= QUANTUM) self sampling keeps running.
      (memory and performance leak)
   -> else self sampling stopped, but slowness report with combined 
      sampling data of all dispatched events between event from 1) 
      and event from 4)

I'm not sure if my investigation and all of my implications are right,
but I attach a patch that will at least fix the warning.

Regards
Florian
Comment 1 fvogler 2010-11-24 18:23:47 UTC
Created attachment 103301 [details]
Fix synchronization in TimableEventQueue
Comment 2 Jaroslav Tulach 2010-11-25 08:43:25 UTC
Your analysis makes sense. Thanks for the fix: core-main#e362b7085285
Comment 4 Jaroslav Tulach 2010-11-25 14:00:10 UTC
Test failure addressed in core-main#ccc12e53266c
Comment 5 Quality Engineering 2010-11-26 06:12:42 UTC
Integrated into 'main-golden', will be available in build *201011260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/e362b7085285
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #192427: Insufficient synchronization in TimableEventQueue by fvogler@netbeans.org
Comment 6 Jaroslav Tulach 2010-11-29 09:11:39 UTC
Credits: core-main#d28d89bedf6b
Comment 7 Quality Engineering 2010-11-30 06:13:55 UTC
Integrated into 'main-golden', will be available in build *201011300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/d28d89bedf6b
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #192427: Credits for Florian
Comment 8 Jaroslav Tulach 2010-12-07 12:59:34 UTC
*** Bug 192968 has been marked as a duplicate of this bug. ***