Bug 250211 - [search] Organize Imports Hangs
Summary: [search] Organize Imports Hangs
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.4.2   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
: 251737 252315 254611 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-08 22:13 EDT by Gary Karasiuk CLA
Modified: 2009-02-03 17:01 EST (History)
6 users (show)

See Also:


Attachments
stack traces (3.37 MB, application/octet-stream)
2008-10-08 22:13 EDT, Gary Karasiuk CLA
no flags Details
Proposed patch on top of 3.4.1 (4.18 KB, patch)
2008-10-28 06:55 EDT, Frederic Fusier CLA
no flags Details | Diff
Proposed patch for R3_4_maintenance stream (8.64 KB, patch)
2008-10-30 08:55 EDT, Frederic Fusier CLA
no flags Details | Diff
Proposed patch for R3_4_maintenance branch (8.83 KB, patch)
2008-10-31 10:25 EDT, Frederic Fusier CLA
no flags Details | Diff
Proposed patch on HEAD stream (6.69 KB, patch)
2008-10-31 12:56 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gary Karasiuk CLA 2008-10-08 22:13:43 EDT
Created attachment 114618 [details]
stack traces

We are an Eclipse adopter. One of our users reported the following problem:

When running an 'Organize Imports' on the Commerce workspace, the process will hang for a very long time.  I've left it running for a couple of hours with not return and my only recourse was to kill the process.  I've also noticed that occasionally my CPU utilization will be 100% but there are no jobs running in RAD.  I've taken several thread dumps from these occasions and the results are the same.  I've included the thread dumps in the defect.

I've looked through the stack traces, they all have to do with JavaSearchScope

org/eclipse/jdt/internal/core/search/JavaSearchScope.add(Bytecode PC:621(Compiled Code))
Comment 1 Jerome Lanneluc CLA 2008-10-09 09:23:24 EDT
I'm not seeing a hang in the attached stack traces. The code is running normally. However there might be a performance problem.

We would need more details to debug this problem:
- the Eclipse build id
- steps to reproduce the problem 
Comment 2 Frederic Fusier CLA 2008-10-23 05:10:58 EDT
*** Bug 251737 has been marked as a duplicate of this bug. ***
Comment 3 Frederic Fusier CLA 2008-10-23 05:12:15 EDT
*** Bug 251737 has been marked as a duplicate of this bug. ***
Comment 4 Frederic Fusier CLA 2008-10-23 05:13:05 EDT
(In reply to comment #1)
> I'm not seeing a hang in the attached stack traces. The code is running
> normally. However there might be a performance problem.
> 
> We would need more details to debug this problem:
> - the Eclipse build id
> - steps to reproduce the problem 
> 
Please provide requested info to help us to reproduce and fix, thanks
Comment 5 Gary Karasiuk CLA 2008-10-23 06:59:30 EDT
(In reply to comment #4)
> (In reply to comment #1)
> > I'm not seeing a hang in the attached stack traces. The code is running
> > normally. However there might be a performance problem.
> > 
> > We would need more details to debug this problem:
> > - the Eclipse build id
> > - steps to reproduce the problem 
> > 
> Please provide requested info to help us to reproduce and fix, thanks
> 
For this defect I was passing along information from one of our users (Brian Lima who is on the CC list for this defect). For that problem they are using the version of our product that is built on Eclipse 3.4.

For the new defect that I opened (Bug 251737), it was using a more current version of Eclipse 3.4.1.

Comment 6 Brian Lima CLA 2008-10-23 13:23:50 EDT
Reproducing the issue is quite easy when using the full WebSphere Commerce workspace.  Problem is this workspace is internal to IBM so only IBMers can work on it (maybe not so much an issue for this defect?).

I've seen the problem when I run Organize Imports in the Java editor.  It'll lock up the GUI with no way to cancel.  Only way to stop is to kill the Java process.
Comment 7 Frederic Fusier CLA 2008-10-27 08:31:05 EDT
This is a side effect of fix for bug 229951. Project may be removed from the projectsToBeAdded set and so may be added to the scope several times. As in this workspace, there are 166 projects with a huge and deep references tree, we're facing a dramatic performance issue :-(
Comment 8 Frederic Fusier CLA 2008-10-28 05:43:47 EDT
*** Bug 252315 has been marked as a duplicate of this bug. ***
Comment 9 Frederic Fusier CLA 2008-10-28 06:55:21 EDT
Created attachment 116274 [details]
Proposed patch on top of 3.4.1

I will test this patch this afternoon onto the workspace of Gary's machine...
Comment 10 Frederic Fusier CLA 2008-10-28 06:57:46 EDT
Jerome, is it OK to address this issue for 3.4.2?
Comment 11 Jerome Lanneluc CLA 2008-10-28 08:48:35 EDT
+1 for 3.4.2 since this is a performance regression comparing to 3.3.x and the symptoms are pretty bad (it takes an infinite amount of time to complete)
Comment 12 Frederic Fusier CLA 2008-10-28 10:26:47 EDT
Really good news, the fix works :-) I was able to perform any search request in the 'Commerce' workspace: it took only around 31ms to create the scope...
Comment 13 Frederic Fusier CLA 2008-10-30 08:55:23 EDT
Created attachment 116511 [details]
Proposed patch for R3_4_maintenance stream
Comment 14 Frederic Fusier CLA 2008-10-31 10:25:33 EDT
Created attachment 116617 [details]
Proposed patch for R3_4_maintenance branch

Test has been improved in this new patch.
Comment 15 Frederic Fusier CLA 2008-10-31 10:26:18 EDT
Released for 3.4.2 in R3_4_maintenance stream.
Comment 16 Frederic Fusier CLA 2008-10-31 12:56:20 EDT
Created attachment 116633 [details]
Proposed patch on HEAD stream
Comment 17 Frederic Fusier CLA 2008-10-31 12:56:57 EDT
Released for 3.5M4 in HEAD stream.
Comment 18 Frederic Fusier CLA 2008-11-10 14:56:28 EST
*** Bug 254611 has been marked as a duplicate of this bug. ***
Comment 19 Kent Johnson CLA 2008-12-09 13:55:08 EST
Verified for 3.5M4 using I20081209-0100
Comment 20 Frederic Fusier CLA 2009-02-03 17:01:36 EST
(In reply to comment #12)
> Really good news, the fix works :-) I was able to perform any search request in
> the 'Commerce' workspace: it took only around 31ms to create the scope...
> 
Verified for 3.4.2 on Gary's machine