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 38554 - Deadlock after copy & paste of Ant Script Execution
Summary: Deadlock after copy & paste of Ant Script Execution
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Execution (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: THREAD
Depends on:
Blocks:
 
Reported: 2004-01-08 19:40 UTC by _ tboudreau
Modified: 2008-12-22 23:48 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stack trace (14.67 KB, text/plain)
2004-01-08 19:41 UTC, _ tboudreau
Details
Stack trace from second run, no missing threads this time (23.11 KB, text/plain)
2004-01-08 19:51 UTC, _ tboudreau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2004-01-08 19:40:46 UTC
Dual processor machine.

Will attach stack trace - buffer wasn't big enough
to catch all of it, but the important parts are there.
Comment 1 _ tboudreau 2004-01-08 19:41:18 UTC
Created attachment 12794 [details]
stack trace
Comment 2 _ tboudreau 2004-01-08 19:50:56 UTC
Possibly let Jirka resolve the other weirdness with new service types
first, but I think this is a seperate problem.  Wanting to avoid the
weirdness, I tried just copy-pasting ant execution (to create a custom
executor to run the openide unit tests).

I'm stunned by the number of layers here!  Node -> Data Object ->
FileObject -> Registry -> DOM Object -> ProxyLookup -> FolderLookup ->
FolderInstance -> FileObject.  (What exactly *do* the last five layers
accomplish?  No, I don't want to know).

It's completely reproducable, so I'm attaching a better stack trace.

BTW, I'm also curious why immediately after restarting there are 29
(!!) inactive request processor threads.  I'll file that separately.
Comment 3 _ tboudreau 2004-01-08 19:51:40 UTC
Created attachment 12795 [details]
Stack trace from second run, no missing threads this time
Comment 4 Petr Nejedly 2004-01-09 08:35:14 UTC
As I haven't find the other issue, I'm commenting here.
The inactive processors come from wrong usage of RP.
Somebody is posting bulk of runnables into RP.getDefault() which is
not designed for this usage. RP.getDefault() is multithreaded
(artifical limit of 50 threads) so runs all the requests in parallel.
I've added a bit of diagnostics to RP (the "Was:" part of the name)
but it is still not enough (just shows that somebody abuses
RP.getDefault(). In case of Was: VCS... it would be OK - there were
more VCS commands running in paralel).
I'll add more diagnostics there (class of the action) so we can nail
down the culprit... 
Comment 5 _ tboudreau 2004-01-09 09:56:30 UTC
You haven't found the other issue because I wanted to diagnose who was
doing it first, to file it correctly...and then my girlfriend stole
the computer from me for the evening :-)

Conceivably related: issue 38458 - possibly VCS trying (and failing)
to refresh folders?  At least it's something that could reasonably
attempt 29 asynchronous operations after startup...
Comment 6 Marian Mirilovic 2004-01-14 15:24:16 UTC
changing owner dkonecny -> pnejedly
Comment 7 Petr Nejedly 2004-01-29 14:58:50 UTC
The problem:
dataObject.copy grabs the DataObjectPool "real atomicity support"
and then performs the real operation (do copy), which fires events,
and one of the listeners in effect waits for a FolderInstance.
The FolderInstance is then processed in its own thread, but can't
proceed with recognizing of files, while the DOP is "locked".

Yarda, you've added the DataObjectPool guarding code.
Shouldn't the final firing be performed out of the DOP guard?
Comment 8 Jaroslav Tulach 2004-01-29 15:53:11 UTC
That would be much better. The simplest fix is to first start
runAtomicAction and then grab the DataObjectPool internal code. I can
do it myself, if you want.
Comment 9 Petr Nejedly 2004-01-29 15:55:54 UTC
OK, yarda, it's yours.
Comment 10 Jaroslav Tulach 2004-01-29 22:42:56 UTC
Checking in loaders/src/org/openide/loaders/DataObjectPool.java;
/cvs/openide/loaders/src/org/openide/loaders/DataObjectPool.java,v 
<--  DataObjectPool.java
new revision: 1.19; previous revision: 1.18
done
Processing log script arguments...
More commits to come...
RCS file:
/cvs/openide/test/unit/src/org/openide/loaders/Deadlock38554Test.java,v
done
Checking in test/unit/src/org/openide/loaders/Deadlock38554Test.java;
/cvs/openide/test/unit/src/org/openide/loaders/Deadlock38554Test.java,v
 <--  Deadlock38554Test.java
initial revision: 1.1
Comment 11 Marian Mirilovic 2004-02-26 17:07:39 UTC
Tim,
please verify (just try it and if not happend mark VERIFIED),
 thanks in advance.
Comment 12 Marian Mirilovic 2004-03-15 15:35:10 UTC
I can't reproduce it in [nb_36_rc1](200403141830)