Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Eclipse Web Tools Platform Project (WTP) » Proper way to implement cancellable validators/validators occasionally running "forever"
Proper way to implement cancellable validators/validators occasionally running "forever" [message #1771318] Thu, 24 August 2017 01:43 Go to next message
John Ruud is currently offline John RuudFriend
Messages: 17
Registered: July 2009
Junior Member
Hi, we have implemented various validators, typically based on: org.eclipse.wst.xml.core.internal.validation.eclipse.Validator.

In most cases users are able to quickly cancel validation by pressing the red 'Cancel Operation' button in the progress dialog. However, in rare cases I observe that multiple individual validators are cancelled, while many others are still running, and validation ends up taking a very long time (sometimes 10+ minutes, or even worse).

Does the following validator cancellation code look reasonable, or is there a better way? Not sure what the root cause of the long running validation sessions is,
while it might be related to switching of workspaces, and validation possibly being triggered by multiple-multiple resource change events rather than just one.

@Override
public ValidationResult validate(IResource resource, int kind, ValidationState valState, IProgressMonitor monitor) {
ValidationResult vr = super.validate(resource, kind, valState, monitor);
if (monitor != null && monitor.isCanceled()) {
vr.setCanceled(true);
vr.setSuspendValidation(resource.getProject()); // also suspend validation for project
}
}
Re: Proper way to implement cancellable validators/validators occasionally running "forever&quo [message #1771966 is a reply to message #1771318] Fri, 01 September 2017 18:16 Go to previous message
John Ruud is currently offline John RuudFriend
Messages: 17
Registered: July 2009
Junior Member
FYI still not sure how to properly cancel the validators, while after resolving the performance issue (the validator index wasn't updated correctly) then cancelling is not as important as it used to be.
Previous Topic:Neon JS Autocompletion
Next Topic:Indexing JSR-109 Web Services has encountered a Problem
Goto Forum:
  


Current Time: Sun Sep 23 14:04:25 GMT 2018

Powered by FUDForum. Page generated in 0.05476 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top