Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompletionHandler doesn't handle OperationCanceledException gracefully #240

Closed
fbricon opened this issue May 29, 2017 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented May 29, 2017

From vscode-java, while trying to autocomplete while the server is still starting:

[Error - 10:55:15 AM] 29-May-2017 10:55:11 AM Problem with codeComplete for file:///Users/fbricon/Dev/souk/vertx-game-server/src/main/java/Foo.java
null
org.eclipse.core.runtime.OperationCanceledException
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.checkCancel(CompletionEngine.java:1819)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.acceptType(CompletionEngine.java:1315)
	at org.eclipse.jdt.internal.core.SearchableEnvironment$4.acceptType(SearchableEnvironment.java:422)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine$5.acceptIndexMatch(BasicSearchEngine.java:1808)
	at org.eclipse.jdt.core.search.SearchPattern.acceptMatch(SearchPattern.java:319)
	at org.eclipse.jdt.core.search.SearchPattern.findIndexMatches(SearchPattern.java:2348)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.findIndexMatches(MatchLocator.java:280)
	at org.eclipse.jdt.internal.core.search.PatternSearchJob.search(PatternSearchJob.java:109)
	at org.eclipse.jdt.internal.core.search.PatternSearchJob.execute(PatternSearchJob.java:65)
	at org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob(JobManager.java:262)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.searchAllTypeNames(BasicSearchEngine.java:1816)
	at org.eclipse.jdt.internal.core.SearchableEnvironment.findTypes(SearchableEnvironment.java:432)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.findTypesAndPackages(CompletionEngine.java:10832)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.completionOnSingleNameReference(CompletionEngine.java:3451)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1849)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:2075)
	at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:131)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:357)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:345)
	at org.eclipse.jdt.ls.core.internal.handlers.CompletionHandler.computeContentAssist(CompletionHandler.java:79)
	at org.eclipse.jdt.ls.core.internal.handlers.CompletionHandler.lambda$0(CompletionHandler.java:39)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

I think there's no need to propagate OperationCanceledException all the way up. It could be caught and CompletionHandler.computeContentAssist could just return an empty collection.

This raises the issue of how to deal with cancelled monitors in general. Who should be responsible for dealing with them? @gorkem?

@fbricon fbricon added the bug label May 29, 2017
fbricon added a commit to fbricon/eclipse.jdt.ls that referenced this issue Jun 9, 2017
@fbricon fbricon self-assigned this Jun 9, 2017
fbricon added a commit that referenced this issue Jun 9, 2017
@fbricon fbricon added this to the Mid June 2017 milestone Jun 9, 2017
aeschli pushed a commit to aeschli/eclipse.jdt.ls that referenced this issue Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant