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

Must not start write action from within read action in the other thread - deadlock is coming #21

Closed
BorzdeG opened this issue Nov 14, 2018 · 9 comments
Labels
bug Something isn't working
Milestone

Comments

@BorzdeG
Copy link
Contributor

BorzdeG commented Nov 14, 2018

java.lang.Throwable: Must not start write action from within read action in the other thread - deadlock is coming
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:134)
	at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:238)
	at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.compute(WriteCommandAction.java:136)
	at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:368)
	at io.gitlab.arturbosch.detekt.DetektAnnotator.doAnnotate(DetektAnnotator.kt:34)
	at io.gitlab.arturbosch.detekt.DetektAnnotator.doAnnotate(DetektAnnotator.kt:29)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:184)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.getInfos(ExternalToolPass.java:136)
	at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl.runMainPasses(DaemonCodeAnalyzerImpl.java:264)
	at com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl.lambda$runMainPasses$5(CodeSmellDetectorImpl.java:193)
	at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$0(DumbService.java:79)
	at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$1(DumbService.java:123)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:977)
	at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
	at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:116)
	at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:79)
	at com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl.runMainPasses(CodeSmellDetectorImpl.java:193)
	at com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl.lambda$findCodeSmells$4(CodeSmellDetectorImpl.java:174)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:582)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:87)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
	at com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl.findCodeSmells(CodeSmellDetectorImpl.java:173)
	at com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl.findCodeSmells(CodeSmellDetectorImpl.java:151)
	at com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl.access$000(CodeSmellDetectorImpl.java:57)
	at com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl$1.run(CodeSmellDetectorImpl.java:114)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:727)
	at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:442)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:582)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:87)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$null$10(ApplicationImpl.java:592)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

IntelliJ IDEA 2018.3 EAP (Ultimate Edition)
Build #IU-183.4284.36, built on November 7, 2018
macOS 10.14.2

@schalkms
Copy link
Member

Thanks for reporting this. It might be related to 596f073.
@bjoernQ do you have any idea what could cause this.

@bjoernQ
Copy link
Contributor

bjoernQ commented Nov 24, 2018

To be honest I don't have an idea right now.

Is this always reproducible (with that version of IDEA)? Did it work before (with a different version of IDEA)?

If there are extra steps involved to trigger this: which steps?

The best option in general would be to have a way to run the analysis on the in-memory representation of the file so we don't have to force write the file ... Looked into that but would require a larger refactoring

@arturbosch
Copy link
Member

I do not see this error when using IntelliJ 2018.2.5 so maybe a 2018.3 issue.
Updating right now to check this out.
@bjoernQ that makes sense. Will look into this.

@BorzdeG
Copy link
Contributor Author

BorzdeG commented Nov 25, 2018

@arturbosch The error is also present in 2018.2.6

@arturbosch arturbosch added the bug Something isn't working label Dec 9, 2018
@PinkieSwirl
Copy link

Encountered this on 2018.3.4 after initial committing a project (about 24 times, about the order of committed code files).

@vasanthdharmaraj
Copy link

I am encountering this frequently in IJ 2019.1. Looks like there is no pattern to when it occurs. Most recently, I just opened IJ and browsed to 3 different kotlin files. :-(

@arturbosch
Copy link
Member

I get this error when commiting or debugging in 2019.1...

@erichoswald
Copy link

I get it whenever I commit in 2019.1.2

@kajsa
Copy link

kajsa commented Sep 11, 2019

I'm getting it on opening IntelliJ with a kotlin file open, in IntelliJ IDEA 2019.2.2 Preview (Ultimate Edition) Build #IU-192.6603.8, built on August 29, 2019.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants