Bug 78865 - Deadlock in TopLogging.LookupDel.publish vs. folder lookup & folder recognizer
Deadlock in TopLogging.LookupDel.publish vs. folder lookup & folder recognizer
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: -- Other --
6.x
All All
: P2 (vote)
: 6.x
Assigned To: Jaroslav Tulach
issues@platform
http://www.netbeans.org/download/dev/...
: RANDOM, THREAD
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-22 05:53 UTC by Jesse Glick
Modified: 2008-12-22 16:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
I guess this deserves a little review especially because I had to patch MockServices and Lookup (12.27 KB, patch)
2006-06-29 16:42 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2006-06-22 05:53:53 UTC
See thread dump. Seems to have been a random deadlock in commit validation.
Looks to me like TopLogging.LookupDel should not be calling Lookup.lookupAll
synchronously from logging methods; logging is too low-level (can be called from
any System.err.println) and lookup is too risky (can acquire locks and wait for
foreign threads, as here). Suggest that LookupDel listen to a Lookup.Result and
asynchronously update a cached field, as is done e.g. for
InstalledFileLocator.getInstances or URLMapper.getInstances.

BTW I am guessing that the actual stack trace it was trying to print when it
deadlocked was

ClassNotFoundException: org.netbeans.libs.jsch.ClasspathProviderImpl

Seems you forgot to delete

libs/jsch/src/META-INF/services/org.apache.tools.ant.module.spi.AutomaticExtraClasspathProvider

so I just did that.
Comment 1 Jaroslav Tulach 2006-06-22 06:57:04 UTC
I see. Thanks for the metainf fix. I'll fix the LookupDel soon.
Comment 2 Jaroslav Tulach 2006-06-29 16:42:29 UTC
Created attachment 31519 [details]
I guess this deserves a little review especially because I had to patch MockServices and Lookup
Comment 3 Jaroslav Tulach 2006-06-30 09:03:54 UTC
"#78865: Solving a deadlock while logging, plus making 
MockServices.setServices fire changes to clients listening on 
Looukup.getDefault().lookupResults" xtest/nbjunit/apichanges.xml 
xtest/nbjunit/manifest.mf
Checking in xtest/nbjunit/apichanges.xml;
/shared/data/ccvs/repository/xtest/nbjunit/apichanges.xml,v  <--  
apichanges.xml
new revision: 1.4; previous revision: 1.3
done
Checking in xtest/nbjunit/manifest.mf;
/shared/data/ccvs/repository/xtest/nbjunit/manifest.mf,v  <--  manifest.mf
new revision: 1.15; previous revision: 1.14
done
Checking in core/startup/src/org/netbeans/core/startup/TopLogging.java;
/shared/data/ccvs/repository/core/startup/src/org/netbeans/core/startup/TopLogging.java,v  
<--  TopLogging.java
new revision: 1.16; previous revision: 1.15
done
Checking in 
core/startup/test/unit/src/org/netbeans/core/startup/TopLoggingLookupTest.java;
/shared/data/ccvs/repository/core/startup/test/unit/src/org/netbeans/core/startup/TopLoggingLookupTest.java,v  
<--  TopLoggingLookupTest.java
new revision: 1.3; previous revision: 1.2
done
Checking in openide/util/arch.xml;
/shared/data/ccvs/repository/openide/util/arch.xml,v  <--  arch.xml
new revision: 1.7; previous revision: 1.6
done
Checking in openide/util/src/org/openide/util/Lookup.java;
/shared/data/ccvs/repository/openide/util/src/org/openide/util/Lookup.java,v  
<--  Lookup.java
new revision: 1.9; previous revision: 1.8
done
Checking in xtest/nbjunit/src/org/netbeans/junit/MockServices.java;
/shared/data/ccvs/repository/xtest/nbjunit/src/org/netbeans/junit/MockServices.java,v  
<--  MockServices.java
new revision: 1.5; previous revision: 1.4
done
Checking in 
xtest/nbjunit/test/unit/src/org/netbeans/junit/MockServicesTest.java;
/shared/data/ccvs/repository/xtest/nbjunit/test/unit/src/org/netbeans/junit/MockServicesTest.java,v  
<--  MockServicesTest.java
new revision: 1.4; previous revision: 1.3
Comment 4 Jesse Glick 2006-06-30 19:00:39 UTC
+import com.sun.org.apache.bcel.internal.generic.LOOKUPSWITCH;

?!


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo