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 71944 - Deadlock from DataObject.delete
Summary: Deadlock from DataObject.delete
Status: RESOLVED WORKSFORME
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: RANDOM, THREAD
Depends on:
Blocks:
 
Reported: 2006-01-27 20:52 UTC by Jesse Glick
Modified: 2008-12-23 00:39 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump (25.16 KB, text/plain)
2006-01-27 20:53 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2006-01-27 20:52:59 UTC
Some attempts to delete folders and files from the Favorites node earlier in the
IDE session had failed - selection was cleared but the nodes remained (and the
files seemed to still be there on disk). I forgot about it and went to do other
stuff. Much later I tried to rename a file in Projects and immediately got a
deadlock.

Mustang, dev build.
Comment 1 Jesse Glick 2006-01-27 20:53:21 UTC
Created attachment 28624 [details]
Thread dump
Comment 2 Jaroslav Tulach 2006-05-04 11:42:03 UTC
Where is the deadlock? I see none. Can you either:
1. advice where the deadlock is
2. simulate once again with logging enabled ala: 
-J-Dorg.openide.loaders.DataObjectPool.level=100
Comment 3 Jesse Glick 2006-05-04 15:16:21 UTC
Obviously it's a deadlock - EQ is blocked, the IDE was frozen.
DataObjectPool.enterRecognition is waiting for something and never notified. I
don't know what causes it but clearly under some conditions the DOP
synchronization system can fail to unblock. Perhaps some process in another
thread (not shown in the thread dump) terminated unexpectedly and failed to
notify waiting threads. I guess it should be possible to analyze all code which
synchronizes on this monitor and either see the potential problem, or introduce
logging which would produce information on what happened, if it happens again.

I doubt I can reproduce, sorry. As the first sentence of my original description
indicates, probably something went wrong long before the deadlock occurred,
leaving the pool blocked, but I have no idea what that might have been.
Comment 4 Jaroslav Tulach 2006-05-04 16:28:29 UTC
I agree it is a starvation, but it is not a deadlock. You are right, some 
thread probably forget to notify, but how am I supposed to know which one? 
There is a lot of logging around this piece of code, but unless I know more, I 
doubt I can do anything. PS: The code was carefully reviewed few times 
already, even by pnejedly, etc.
Comment 5 Jesse Glick 2006-05-04 17:19:12 UTC
OK, starvation not deadlock.
Comment 6 Jaroslav Tulach 2006-05-05 07:37:38 UTC
So now, when we have agreed that this is starvation and not deadlock, then it 
should be clear that just a thread dump is not sufficient to describe what 
went wrong. 

I agree that something went wrong, but unless I get more info, there is 
nothing to do about this bug. It is either needed to generate a lot file with 
failure, or find a reproducible scenario. I understand that none of this is 
easy, and as such this is a candidate for the never be closed bug. Which is 
wrong, it is just incomplete report and it does work for me. That is why I am 
closing it. Feel free to reopen when you have some new info.
Comment 7 Jesse Glick 2006-05-05 15:32:23 UTC
OK. Hasn't happened to me again since then so may not be a high priority. Still,
if it is possible to trigger proper log messages when this kind of starvation
happens, that would be ideal; this doesn't look like the sort of thing that is
going to be easily reproduced, but it may be affecting people in the field.
Currently there is some logging but it is always off by default, which makes it
not very useful - I would want it to notice the starvation and log something
about it. In this case it seems that DOP.enterRecognition is called, and calls
wait(), but there is no matching notifyAll(). Or Validator.exit() is called and
does notify() but there are multiple threads waiting.