Bug 61130 - Using 05051045, deadlock while shutting down the workspace
Summary: Using 05051045, deadlock while shutting down the workspace
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-05 16:46 EDT by Olivier Thomann CLA
Modified: 2004-05-13 17:19 EDT (History)
4 users (show)

See Also:


Attachments
Thread dump (13.79 KB, text/plain)
2004-05-05 16:47 EDT, Olivier Thomann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2004-05-05 16:46:41 EDT
I started a workspace that I close almost right away. Eclipse took 100% of the
CPU for several minutes and finally didn't shut down.
I will attach a thread dump.
Comment 1 Olivier Thomann CLA 2004-05-05 16:47:04 EDT
Created attachment 10307 [details]
Thread dump
Comment 2 John Arthorne CLA 2004-05-05 18:12:26 EDT
This doesn't look like a deadlock:

- UI thread is blocked waiting for plugins to shutdown
- The plugin shutdown thread (System Bundle Shutdown) is inside JavaCore.stop,
and is doing Thread.join on the Java indexing thread.
- Java indexing thread is in the middle of indexing a JAR file
- "All Types Caching" is in the middle of Java model initialization.

It looks like the Java indexer needs to be more responsive to shutdown.
Comment 3 Philipe Mulet CLA 2004-05-06 05:41:48 EDT
Kent - isn't that the issue I had raised a while ago ? The merge seems to take 
forever ?

I don't see the point of populating the all types cache at this stage. CC'ing 
Dirk.
Comment 4 Dirk Baeumer CLA 2004-05-06 06:51:31 EDT
The all types cache is automatically populated after the UI has been active 
for a while. So whatever delay we pick there is a window to get hit by this. 
We do poluate the cache to avoid the "Searching..." when you first open the 
Opent Type Dialog.
Comment 5 Philipe Mulet CLA 2004-05-06 07:05:24 EDT
When shutdown occurs, you could cancel this activity, since it isn't going to 
be useful in the end. This is likely what induces some of the index activity 
to complete (need to double check this point).
Comment 6 Dirk Baeumer CLA 2004-05-06 08:19:46 EDT
That's correct.
Comment 7 Andre Weinand CLA 2004-05-06 09:03:31 EDT
I'm already cancelling the AllTypesCache thread on shutdown of the Java UI.

For N20040507 I've added additional code that calls setCanceled(true) on the progress monitor I pass 
into the jdt.core's searchAllTypeNames(...).
Comment 8 Kent Johnson CLA 2004-05-13 17:19:15 EDT
Using 20040513 8 AM

I deleted all my index files to ensure the indexer would be busy after the 
AllTypesCache started & I could not exit (with Alt-F4 or hitting the close 
button) until the cache was computed because of bug 61014.

When I didn't have an editor open (so the AllTypesCache runs in the 
background), it worked fine & I couldn't reproduce this problem.