gejun123456 / MyBatisCodeHelper-Pro

http://brucege.com
1.91k stars 240 forks source link

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

Open accpay219 opened 2 years ago

accpay219 commented 2 years ago
                    <!--https://github.com/gejun123456/MyBatisCodeHelper-Pro/issues/new paste current content to github issues-->

重现步骤(Repeat steps)

当前使用版本(Current Version)

IntelliJ IDEA 2022.1.2 • Notes plugin com.ccnode.codegenerator.MyBatisCodeHelperPro 3.0.6

Exception

null

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:182)
    at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.run(WriteCommandAction.java:118)
    at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:362)
    at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:350)
    at com.ccnode.codegenerator.X.aq.invoke(aq.java:73)
    at com.intellij.codeInsight.intention.PsiElementBaseIntentionAction.invoke(PsiElementBaseIntentionAction.java:41)
    at com.intellij.codeInsight.intention.impl.config.IntentionActionWrapper.invoke(IntentionActionWrapper.java:61)
    at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.lambda$invoke$0(IntentionActionWithTextCaching.java:224)
    at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:147)
    at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.invoke(IntentionActionWithTextCaching.java:224)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.generatePreview(IntentionPreviewComputable.kt:106)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.tryCreateDiffContent(IntentionPreviewComputable.kt:59)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.call(IntentionPreviewComputable.kt:37)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.call(IntentionPreviewComputable.kt:32)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:536)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$3(NonBlockingReadActionImpl.java:501)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1152)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:75)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:158)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:115)
    at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:58)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
    at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:58)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:112)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:75)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:501)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:408)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    at java.base/java.lang.Thread.run(Thread.java:829)
gejun123456 commented 2 years ago

这个是啥功能的报错

gejun123456 commented 2 years ago

ctrl q 关掉intention preview 是不是就好了

zmlgit commented 2 years ago

我也碰到了这个错,貌似是在mybatis-plus生成的Service里添加一个方法,然后点黄色的小灯泡,实现方法的时候,会报这个错

gejun123456 commented 2 years ago

我也碰到了这个错,貌似是在mybatis-plus生成的Service里添加一个方法,然后点黄色的小灯泡,实现方法的时候,会报这个错

清掉日志 能稳定重现么

zmlgit commented 2 years ago

我也碰到了这个错,貌似是在mybatis-plus生成的Service里添加一个方法,然后点黄色的小灯泡,实现方法的时候,会报这个错

清掉日志 能稳定重现么

能稳定重现。操作步骤:1,在Service 接口 新建一个方法,2,双击方法名,左侧出现小灯泡,3,点开小灯泡,鼠标在选项中下滑,IDE报错。这个步骤稳定重现

gejun123456 commented 2 years ago

谢谢 找到原因了 3.0.7 修复

gejun123456 commented 2 years ago

https://share.weiyun.com/oQnC6rj1