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

java.lang.Throwable: Access is allowed from Event Dispatch Thread (EDT) only #103

Closed
2 tasks done
Petrox opened this issue Dec 22, 2023 · 9 comments
Closed
2 tasks done

Comments

@Petrox
Copy link

Petrox commented Dec 22, 2023

Step 1: Are you in the right place?

  • I have verified there are no duplicate active or recent bugs, questions, or requests
  • I have verified that I am using the latest version of the plugin.

Step 2: Describe your environment

  • Plugin version: 0.16.2
  • PyCharm/IDEA version: 2023.3.2 (had the same message with earlier versions too.
  • Pylint version: 3.0.2 (windows, via pip)

Step 3: Describe the problem:

Steps to reproduce:

Not trivial to trigger, it pops up usually when try to commit, save, so probably on filechange, sometimes after stopping the running process (the app I'm developing, but that could also trigger a filesystem change).

java.lang.Throwable: Access is allowed from Event Dispatch Thread (EDT) only
	at com.intellij.openapi.vcs.changes.ui.ChangesTree.getInclusionModel(ChangesTree.java:549)
	at com.intellij.openapi.vcs.changes.ui.ChangesTree.getIncludedSet(ChangesTree.java:617)
	at com.intellij.openapi.vcs.changes.ui.VcsTreeModelData$IncludedUnderData.<init>(VcsTreeModelData.java:255)
	at com.intellij.openapi.vcs.changes.ui.VcsTreeModelData.included(VcsTreeModelData.java:54)
	at com.intellij.vcs.commit.ChangesViewCommitPanel.getIncludedChanges(ChangesViewCommitPanel.kt:191)
	at com.intellij.vcs.commit.AbstractCommitWorkflowHandlerKt.getIncludedPaths(AbstractCommitWorkflowHandler.kt:42)
	at com.intellij.vcs.commit.CommitProjectPanelAdapter.getVirtualFiles(CommitProjectPanelAdapter.kt:29)
	at com.leinardi.pycharm.pylint.handlers.ScanFilesBeforeCheckinHandler$2.run(ScanFilesBeforeCheckinHandler.java:114)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:434)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:132)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressSynchronously$8(CoreProgressManager.java:518)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:84)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:248)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:73)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:192)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:610)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:685)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:641)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:609)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:78)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:179)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:73)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:248)
	at com.intellij.openapi.progress.impl.ProgressRunner$ProgressRunnable.run(ProgressRunner.java:498)
	at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81)
	at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81)
	at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:86)
	at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:81)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:464)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:840)

Observed Results:

I can close the dialog from Pycharm and then the editor seems to work, then in 10 minutes I'll get a new popup with the same exception.

Expected Results:

Same boring cruise, with basic unused variables and line too longs.

Relevant Code:

Don't know where to look or which part is the cause, looks like internal ide thread conflict, not something that depends on the code or config.

FYI I have github copilot, jetbrains ai something and jetbrains full line completion enabled at the same time, which is not normal, but it shouldn't matter for the pylint plugin much.

@leinardi
Copy link
Owner

Looking at the stacktrace it seems that the issue is happening inside com.intellij.openapi, could it be that this is something that they have to fix?

@bewczardski
Copy link

It looks like this is a change in the 2023.3 Threading Model by Intellij:

Found that link from this support post in the IntelliJ Community forums: https://intellij-support.jetbrains.com/hc/en-us/community/posts/7602780460306-Access-is-allowed-from-event-dispatch-thread-only

@Petrox
Copy link
Author

Petrox commented Jan 22, 2024 via email

@leinardi
Copy link
Owner

leinardi commented Oct 4, 2024

I just made a PR that should fix this issue: #106
Can someone please test and give a confirmation of the fix?

leinardi added a commit that referenced this issue Oct 5, 2024
Fix #103 #105: Defined action update thread for actions
@bewczardski
Copy link

tested with IntelliJ IDEA 2024.1.1 (Ultimate Edition), ran without any issues

@leinardi
Copy link
Owner

leinardi commented Oct 5, 2024

Thank you! I just made a new release, it should be out soon, just waiting for JetBrains approval 👍

@bewczardski
Copy link

bewczardski commented Oct 6, 2024

Apparently I'm not very good at reading version numbers, I thought I was using the latest version but tested with 0.16.2, I just installed 0.16.3 and I'm getting an error related to another PR: #105

com.intellij.diagnostic.PluginException: 'ActionUpdateThread.OLD_EDT' is deprecated and going to be removed soon. 'com.leinardi.pycharm.pylint.actions.ScrollToSource' must override 'getActionUpdateThread()' and chose EDT or BGT. See ActionUpdateThread javadoc. [Plugin: com.leinardi.pycharm.pylint]
	at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
	at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:90)
	at com.intellij.diagnostic.PluginException.reportDeprecatedUsage(PluginException.java:125)
	at com.intellij.openapi.actionSystem.ActionUpdateThreadAware.getActionUpdateThread(ActionUpdateThreadAware.java:21)
	at com.intellij.openapi.actionSystem.AnAction.getActionUpdateThread(AnAction.java:201)

image

Version 0.16.2 does not cause any errors

@leinardi
Copy link
Owner

leinardi commented Oct 7, 2024

@bewczardski thanks! Yeah I forgot to apply the fix to com.leinardi.pycharm.pylint.actions.ScrollToSource. I just released 0.16.4 with a fix for this.

@bewczardski
Copy link

Tested 0.16.4 and that error did not occur, everything looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants