Skip to main content



      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] Wed, 23 August 2017 21:43 Go to next message
Eclipse UserFriend
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 14:16 Go to previous message
Eclipse UserFriend
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 Jul 27 11:56:52 EDT 2025

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

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

Back to the top