Bug 150539 - [hotbug_request] [performance] XDocletFacetInstallDelegate is doing a FULL_BUILD in the UI thread
Summary: [hotbug_request] [performance] XDocletFacetInstallDelegate is doing a FULL_BU...
Status: CLOSED FIXED
Alias: None
Product: WTP EJB Tools
Classification: WebTools
Component: jst.ejb (show other bugs)
Version: 1.5   Edit
Hardware: PC Windows XP
: P2 critical (vote)
Target Milestone: 1.5.1 M151   Edit
Assignee: Naci Dai CLA
QA Contact: Naci Dai CLA
URL:
Whiteboard:
Keywords: performance
: 150644 152559 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-07-13 13:33 EDT by Jeffrey Liu CLA
Modified: 2006-09-26 10:07 EDT (History)
2 users (show)

See Also:


Attachments
Patch for ejb.annotation.xdoclet (2.13 KB, patch)
2006-07-19 15:12 EDT, Jeffrey Liu CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey Liu CLA 2006-07-13 13:33:36 EDT
Build: WTP 1.5.0

In the org.eclipse.jst.j2ee.ejb.annotations.internal.xdoclet.facet.XDocletFacetInstallDelegate class, the execute(...) method, we are doing a FULL_BUILD in the UI thread. This may hang the UI for a few seconds depending on the size of your project. Two questions pop up:

1. Why are we doing a full build? Wouldn't auto build take care of things?
2. If the full build is needed, can we move it to a job?
Comment 1 Jeffrey Liu CLA 2006-07-13 13:35:01 EDT
Rising severity to critical, priority to P2 and setting target to 1.5.1 since this is a hot performance issue.
Comment 2 Naci Dai CLA 2006-07-14 03:24:29 EDT
The build of the XDoclet facet was moved to the wizard UI thread as a workaround during EJB/Servlet creation to force a build.  The problem was although a build request was registered it was being discarded.

We will revisit the problem
Comment 3 Naci Dai CLA 2006-07-15 01:59:05 EDT
*** Bug 150644 has been marked as a duplicate of this bug. ***
Comment 4 Jeffrey Liu CLA 2006-07-19 10:54:49 EDT
Hi Naci, do you mean if you run the build in a Job, the build or the Job is somehow being discarded? If so, that sounds like an Eclipse bug. I'll investigate.

Also, is a full build on the project really necessary? Can't we just do a build with the XDoclet builder and follow by a build from the Java compiler. Is that sufficient?
Comment 5 Naci Dai CLA 2006-07-19 11:59:31 EDT
Jeff, I am not sure if it is an eclipse bug, or smt wrong with the way we start a build (more likely) but I already spent two days chasing it in the guts of eclipse threads and jbos - nothing to envy - But the only thing I can replicate is tha:

-Create first EJB - build works as expcted.
-Create a few more EJBS ,in sequence - and it starts loosing the build job during the creation.
- Modify the EJB in code, builder always works as expected.

My suspicion is that after Java builder completes its job, xdoclet builder is dropped.

More investigating to do
Comment 6 Jeffrey Liu CLA 2006-07-19 14:22:54 EDT
Hi Naci, here're my observations...

- During the creation of the first EJB, the XDocletFacetInstallDelegate is invoked. As a result, this triggers a build, causing the XDoclet builder to run and then the Java builder to run. However, later on in the code, the XDocletBuildUtility is invoked, which triggers the XDoclet builder to run only.

- On subsequence EJB creations, the XDocletFacetInstallDelegate is not invoked. Therefore, no build will be registered. Then XDocletBuildUtility is invoked and causing the XDoclet builder to run. Since no build was registered, the Java builder did not run and the generated Java code was not compiled.

If my understanding is correct, then here's what we need to do:

1. Remove the build from XDocletFacetInstallDelegate.
2. Either register a build at the end of XDocletBuilder's build(...) method, or in XDocletBuildUtility, register a build right after XDocletBuilder is invoked.
Comment 7 Jeffrey Liu CLA 2006-07-19 15:12:51 EDT
Created attachment 46529 [details]
Patch for ejb.annotation.xdoclet

This patch seems to fix the problem. Naci, can you review it?
Comment 8 Jeffrey Liu CLA 2006-07-21 18:59:06 EDT
I've got an adopter to help verify the patch. The adopter indicated that the patch fixed the problem.
Comment 9 Naci Dai CLA 2006-07-22 06:56:05 EDT
Jeff, testing a few cases myself.  I will release the patch for next week's M.
Comment 10 Naci Dai CLA 2006-07-23 01:28:19 EDT
Fixed in M1.51 and R2.0 streams
Comment 11 Naci Dai CLA 2006-08-25 05:51:19 EDT
*** Bug 152559 has been marked as a duplicate of this bug. ***
Comment 12 Darryl Miles CLA 2006-08-27 13:13:17 EDT
In trying to validate this fix for duped bug #152559 with using 3_2-M20060802_WTP_1.5.1-200608241726 the problem still persists.

The UI is hung the whole time while the Right click -> Run XDoclet action is being performed.  When the UI wakes up again the Console output jumps to displaying the completed XDoclet task output.

When removing and readding a project facet for XDoclet support I dont see any visible sign XDoclet was run (no console output) and there is no UI hang.
Comment 13 Naci Dai CLA 2006-08-28 05:41:26 EDT
Daryl,

You are correct.  This fix did not help the action. I wrapped the RunXDoclet action in a user Job object so that it can be put in the background.
Comment 14 Darryl Miles CLA 2006-08-30 13:50:53 EDT
Are additional fixes already in the pipeline towards validating bug #152559 ?

My own understanding of this bug here, there was a UI hang when adding the XDoclet facet to a project.  However with my own testing it does not appear XDoclet runs anymore when being added, is this by design or just unreported so far.  3_2-M20060802_WTP_1.5.1-200608241726

Does Jeffrey agree this bug resolved ?

Naci are you saying this bug (and its fix) should resolve the regression in the right click action causing UI hang ?
Comment 15 Jeffrey Liu CLA 2006-08-30 16:09:22 EDT
I verify that this fixed the "hang" when we create an XDoclet EJB. However, I have not verify this fix against the Run XDoclet action "hang" outlined in bug 152559. That sounds like a separate issue.
Comment 16 Naci Dai CLA 2006-08-31 02:59:51 EDT
Hi Daryl,

There are additional fixes for the UI hanging during the XDoclet action, these are already commited to te 1.5.1 stream, you can use tha latest build from the committers page or wait for this week's M-Build to verify.

Basically, the fix solves your problem by putting the build in a Job, and when the XDoclet action is run a JOB dialog pops up, and if ytou want to continues without waiting for the job to finish, you can click the "Run in the backgorund" button.
Comment 17 John Lanuti CLA 2006-09-26 10:07:31 EDT
Closing.