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 18216 - Deadlock when switching projects in VCS group code
Summary: Deadlock when switching projects in VCS group code
Status: CLOSED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: vcscore (show other bugs)
Version: 3.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-30 09:43 UTC by Jaroslav Tulach
Modified: 2003-07-01 12:57 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump (16.13 KB, text/plain)
2001-11-30 09:44 UTC, Jaroslav Tulach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2001-11-30 09:43:44 UTC
Looks like the VcsGroupChildren does too much work when somebody is trying to
destroy the data object (setValid (false)).
Comment 1 Jaroslav Tulach 2001-11-30 09:44:54 UTC
Created attachment 3637 [details]
Thread dump
Comment 2 Martin Entlicher 2001-11-30 10:19:28 UTC
The refreshAll() method should probably do the work lazily.
What do you think Milos?
Comment 3 Milos Kleint 2001-11-30 11:14:40 UTC
first: Does this happen *everytime*?
Second: why is it P1?
third: what about mentioning the build etc.

To Martin: I'm not sure. What do you mean by lazily? Schedule the
stuff in the request processor will just delay the whole thing and not
guearantee that it will be ok. I noticed 3 threads doing
dataObject.setValid() at the same time. Automount, FolderRecognizer
and Openide..

<rant>
THis is getting quite frustrating. The threading in openide changes
constantly, so do the inner workings of filesystem/datasystems. it's
not only thins case, it happened to us many times lately. And noones
tells what to avoid it or what to write code so that one doesn't get
into such troubles. (Not even mentioning any guarantees). The number
of threads is raising constantly.
 this can't go on endlessly this way. :(
</rant>
Comment 4 Martin Entlicher 2001-11-30 12:04:20 UTC
It seems to me, that the Openide Request Processor is deadlocked with
FolderRecognizer. The problem is, that we run
org.netbeans.modules.vcscore.grouping.VcsGroupChildren.getFilesInGroup
in Request Processor, which later calls FolderList.getChildrenList(),
which waits for FolderRecognizer. But FolderRecognizer is invalidating
another DataObject, which close the circle.
If we spawn a task in RequestProcessor for setKeys(getGroups()); in
refreshAll() that should fix the problem (at least I hope so).
Comment 5 Milos Kleint 2001-11-30 12:44:47 UTC
*nods* probably yes, I got another mostly performance improvement.
The Task that runs the refreshAll() should be checked if in the queue
and if so not run again. (so that it's not run 20 times for 20
invalidated dataobjects (which happens prolly when switching the 
projects..)

Comment 6 Jaroslav Tulach 2001-11-30 13:30:07 UTC
Doing the refresh with a small delay is good solution. Anyway I am
CCing Petr to check whether the brokendatashadows test should not be
also done with a delay, as is shown in the stacktrace it is run in
really dangerous places...
Comment 7 Milos Kleint 2001-11-30 18:17:28 UTC
Ok, I'll fix it over the weekend or on Monday.
Comment 8 Milos Kleint 2001-12-02 16:52:27 UTC
fixed in main trunk and release33 branch.

The fix is quite safe and straightforward. However I'm not sure if
it's worth making it a 330_CANDIDATE. 
Yarda, how ofter was this deadlock? If that was a common case, I
suggest we put it in the 330 branch as well, otherwise I think it can
wait till 3.3.1


http://vcscore.netbeans.org/source/browse/vcscore/src/org/netbeans/modules/vcscore/grouping/VcsGroupChildren.java.diff?r1=text&tr1=1.5&r2=text&tr2=1.6&f=h
Comment 9 Milos Kleint 2001-12-04 08:19:12 UTC
changing to waiver.
Comment 10 Jiri Kovalsky 2001-12-07 10:43:39 UTC
I haven't seen this kind of dead lock so far. Verified in development 
build #200112070331 of NetBeans 3.3.1.
Comment 11 Quality Engineering 2003-07-01 12:57:59 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.