Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313384 - Validation Framework invokes the V1 validators too often
Summary: Validation Framework invokes the V1 validators too often
Status: RESOLVED FIXED
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: wst.validation (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Wini Mark CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks: 313619
  Show dependency tree
 
Reported: 2010-05-18 12:09 EDT by Wini Mark CLA
Modified: 2010-05-25 11:27 EDT (History)
2 users (show)

See Also:
ccc: pmc_approved? (david_williams)
ccc: pmc_approved? (raghunathan.srinivasan)
ccc: pmc_approved? (naci.dai)
deboer: pmc_approved+
ccc: pmc_approved? (neil.hauge)
ccc: pmc_approved? (kaloyan)
ccc: review+


Attachments
Revised patch (13.72 KB, patch)
2010-05-18 13:49 EDT, Wini Mark CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wini Mark CLA 2010-05-18 12:09:32 EDT
Build Identifier: WTP 3.2

Validation Framework invokes the V1 validator too often which causes a
performance problem. The validation framework now invokes the V1 validator per
resource within the project, but it should only invoke the validator per
project. 


Reproducible: Always

Steps to Reproduce:
1.Have a EE project with lots of resources
2.Right click on project and select 'validate'
3.It takes quite a while to validate the project
Comment 1 Wini Mark CLA 2010-05-18 12:10:17 EDT
This bug is a clone of 308326 for committing the patch in WTP 3.2
Comment 2 Wini Mark CLA 2010-05-18 13:49:32 EDT
Created attachment 168980 [details]
Revised patch
Comment 3 Carl Anderson CLA 2010-05-18 21:47:59 EDT
I approve of this patch.

Note that the changes to the public class are a private method and a private static, so this is not an API change.
Comment 4 Wini Mark CLA 2010-05-19 13:17:40 EDT
Require the PMC approval to check in the fix. 

The problem is one of the V1 validator is taking long time(e.g. 20 minutes)  to run the validation and customer's work is highly affected. This is big performance regression.In current release, the validator is called per resource instead of per project in previous releases. In this case, the project has hundreds of resources which make the call to the validator hundreds of times instead of only one.

There is no work around for this problem.

We worked with the validator owner and the fix is to provide new element in the V1 validator extension point. The V1 validator can then specify if the validator will be called per project. 

The fix is safe as we add new element and attribute to an existing extension point. The fix has been tested by adding the element and attribute in the V1 validator plugin to ensure the validator is called by project. Ran some tests on validating different projects both in build and manual scenario to ensure different validators(e.g. JSP, EJB, XML valiadtor) are working as before.
Comment 5 Carl Anderson CLA 2010-05-19 13:26:28 EDT
Putting this up for PMC approval.

Also, as can be seen in bug 308326, Gary Karasiuk and myself have reviewed this fix.
Comment 6 Tim deBoer CLA 2010-05-19 13:42:41 EDT
Hi. It says that this is a regression, but it looks like we're adding a new flag for individual validators to set and the default behaviour isn't changing. Can you clarify what the behaviour was before, what caused the regression, and whether any adopter that hits this would have to make a change to avoid the regression?
Comment 7 Wini Mark CLA 2010-05-19 14:10:47 EDT
Hi Tim, the V1 validators were called per project in old validation framework. After introducing the V2 validation framework, the behavior changed and the V1 validators are called per resource. Recently we noticed this problem from working with a customer performance issue. Gary, Valentin and I have worked together and decided it's too risky to change the logic of validating all V1 validators. In fact, the owner of the V1 validators has been asked to migrate to use the new V2 validation framework.  
The proposed fix is to provide a way for V1 validator to set if this particular validator should be called by project instead of per resource.  We worked with the Java EE team who owns the validator which causes the performance issue and in fact they own the majority of the V1 validators and we all agree this is the most appropriate and safest fix at this moment.   So far we didn't hear any performance issue with other V1 validators, but the adopters will have flexibility to decide if they want to making this change or not.
Comment 8 Carl Anderson CLA 2010-05-19 17:32:24 EDT
Committed to HEAD for WTP 3.2 RC2
Comment 9 Carl Anderson CLA 2010-05-20 13:12:46 EDT
Wini, can you document this new addition to the extension point at http://wiki.eclipse.org/New_Help_for_Old_Friends_V ?
Comment 10 Wini Mark CLA 2010-05-25 11:27:27 EDT
Carl, I have added the information in the document. Thanks.