Closed Clashsoft closed 1 week ago
Hey! Try this custom build with a logging point.
When it happens you should find an exception logged too.
Thank you. So far I was not able to reproduce the problem with that version....
Hey! Let me know if I can close this!
Feel free to close. I will reopen if it ever occurs again :)
I finally got this exception again. Here is the stacktrace:
2024-06-21 19:10:28,161 [ 717377] SEVERE - #com.github.lppedd.cc.api.impl.InternalCommitTokenProvider - Error while reading custom tokens file
java.lang.Throwable: Control-flow exceptions (e.g. this class com.intellij.openapi.progress.ProcessCanceledException) should never be logged. Instead, these should have been rethrown if caught.
at com.intellij.openapi.diagnostic.Logger.ensureNotControlFlow(Logger.java:513)
at com.intellij.idea.IdeaLogger.doLogError(IdeaLogger.java:154)
at com.intellij.idea.IdeaLogger.error(IdeaLogger.java:145)
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:423)
at com.github.lppedd.cc.api.impl.InternalCommitTokenProvider.getDefaults(InternalCommitTokenProvider.kt:34)
at com.github.lppedd.cc.api.impl.InternalCommitTokenProvider.getCommitTypes(InternalCommitTokenProvider.kt:46)
at com.github.lppedd.cc.completion.providers.TypeCompletionProvider$complete$1$1.invoke(TypeCompletionProvider.kt:43)
at com.github.lppedd.cc.completion.providers.TypeCompletionProvider$complete$1$1.invoke(TypeCompletionProvider.kt:42)
at com.github.lppedd.cc.CCExtensionsKt$sam$i$java_util_concurrent_Callable$0.call(CCExtensions.kt)
at com.intellij.openapi.application.ex.ApplicationUtil.runWithCheckCanceled$lambda$3$lambda$1(ApplicationUtil.kt:57)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
at com.intellij.openapi.application.ex.ApplicationUtil.runWithCheckCanceled$lambda$3(ApplicationUtil.kt:54)
at com.intellij.openapi.application.ex.ApplicationUtil$runWithCheckCanceled$deferred$1.invokeSuspend(ApplicationUtil.kt:74)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: com.intellij.openapi.progress.ProcessCanceledException
at com.intellij.openapi.progress.util.AbstractProgressIndicatorBase.throwIfCanceled(AbstractProgressIndicatorBase.java:172)
at com.intellij.openapi.progress.util.AbstractProgressIndicatorBase.checkCanceled(AbstractProgressIndicatorBase.java:165)
at com.intellij.openapi.progress.util.AbstractProgressIndicatorExBase.checkCanceled(AbstractProgressIndicatorExBase.java:98)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.checkCancelledEvenWithPCEDisabled(ProgressIndicatorUtils.java:438)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.awaitWithCheckCanceled(ProgressIndicatorUtils.java:368)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.awaitWithCheckCanceled(ProgressIndicatorUtils.java:362)
at com.intellij.openapi.vfs.DiskQueryRelay.accessDiskWithCheckCanceled(DiskQueryRelay.java:61)
at com.intellij.openapi.vfs.impl.local.LocalFileSystemBase.getAttributes(LocalFileSystemBase.java:722)
at com.intellij.openapi.vfs.impl.local.LocalFileSystemImpl.getAttributes(LocalFileSystemImpl.java:300)
at com.intellij.openapi.vfs.impl.local.LocalFileSystemBase.isDirectory(LocalFileSystemBase.java:180)
at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.findChild(VirtualDirectoryImpl.java:91)
at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.refreshAndFindChild(VirtualDirectoryImpl.java:351)
at com.intellij.openapi.vfs.newvfs.VfsImplUtil.refreshAndFindFileByPath(VfsImplUtil.java:118)
at com.intellij.openapi.vfs.impl.local.LocalFileSystemBase.refreshAndFindFileByPath(LocalFileSystemBase.java:125)
at com.github.lppedd.cc.configuration.CCDefaultTokensService.findDefaultFilePathFromProjectRoot(CCDefaultTokensService.kt:140)
at com.github.lppedd.cc.configuration.CCDefaultTokensService.getDefaultsFromCustomFile(CCDefaultTokensService.kt:60)
at com.github.lppedd.cc.api.impl.InternalCommitTokenProvider.getDefaults(InternalCommitTokenProvider.kt:32)
... 20 more
Looks like the culprit is com.intellij.openapi.vfs.DiskQueryRelay.accessDiskWithCheckCanceled
.
The "process" is cancelled. The problem is, who cancelled this "process"?
I might have to find an alternative way to access the file on disk, or loop until the file is read despite the ProcessCancelledException
.
Do you read the file on every keystroke? It seems that way from when the exceptions occur. Maybe there is some debounce / canceling behavior going on.
Ok, it has been a while I haven't worked on IJ plugins, so I lost some of my knowledge.
The problem is this line
} catch (e: Exception) {
Exception
is too generic, ProcessCancelledException
s should not be caught, they should propagate to the top and be handled by the platform.
This keeps appearing whenever I type anything in the commit message field. There is no error message or anything in the log.
This is the config (nothing changed from the defaults):