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 #2487

Closed
dipakp-logicrays opened this issue Feb 15, 2025 · 1 comment · Fixed by #2498
Closed

Must not start write action from within read action in the other thread #2487

dipakp-logicrays opened this issue Feb 15, 2025 · 1 comment · Fixed by #2498
Assignees
Labels
bug good first issue Priority: P1 Needs to be fixed before any other issues

Comments

@dipakp-logicrays
Copy link

Describe the bug (*)

A clear and concise description of what the bug is.

java.lang.IllegalStateException: Must not start write action from within read action in the other thread - deadlock is coming
	at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.run(WriteCommandAction.java:116)
	at com.magento.idea.magento2plugin.inspections.php.fix.PhpModuleNameQuickFix.applyFix(PhpModuleNameQuickFix.java:48)
	at com.magento.idea.magento2plugin.inspections.php.fix.PhpModuleNameQuickFix.applyFix(PhpModuleNameQuickFix.java:41)
	at com.magento.idea.magento2plugin.inspections.php.fix.PhpModuleNameQuickFix.applyFix(PhpModuleNameQuickFix.java:16)
	at com.intellij.codeInspection.LocalQuickFix.generatePreview(LocalQuickFix.java:81)
	at com.intellij.codeInspection.ex.QuickFixWrapper.generatePreview(QuickFixWrapper.java:234)
	at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.generatePreview(IntentionActionWithTextCaching.java:259)
	at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.invokePreview$lambda$3$lambda$2$lambda$1(IntentionPreviewComputable.kt:121)
	at com.intellij.model.SideEffectGuard$Companion.computeWithAllowedSideEffectsBlocking(SideEffectGuard.kt:42)
	at com.intellij.model.SideEffectGuard$Companion.computeWithoutSideEffects(SideEffectGuard.kt:27)
	at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.invokePreview$lambda$3$lambda$2(IntentionPreviewComputable.kt:120)
	at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.lambda$postponeFormattingInside$2(PostprocessReformattingAspectImpl.java:137)
	at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.postponeFormattingInside(PostprocessReformattingAspectImpl.java:146)
	at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.postponeFormattingInside(PostprocessReformattingAspectImpl.java:136)
	at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.invokePreview$lambda$3(IntentionPreviewComputable.kt:119)
	at com.intellij.codeInsight.intention.preview.IntentionPreviewUtils.previewSession(IntentionPreviewUtils.java:127)
	at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.invokePreview(IntentionPreviewComputable.kt:118)
	at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.generatePreview(IntentionPreviewComputable.kt:87)
	at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.tryCreateDiffContent(IntentionPreviewComputable.kt:63)
	at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.call(IntentionPreviewComputable.kt:46)
	at com.intellij.codeInsight.intention.impl.IntentionHintComponent$IntentionPopup.lambda$getPreviewHandler$4(IntentionHintComponent.java:858)
	at com.intellij.codeInsight.intention.impl.preview.PreviewHandler.lambda$new$0(PreviewHandler.java:53)
	at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewPopupUpdateProcessor$updatePopup$4.invokeSuspend$lambda$0(IntentionPreviewPopupUpdateProcessor.kt:126)
	at com.intellij.openapi.application.rw.InternalReadAction.insideReadAction(InternalReadAction.kt:114)
	at com.intellij.openapi.application.rw.InternalReadAction.tryReadCancellable$lambda$4(InternalReadAction.kt:104)
	at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal$lambda$3$lambda$2$lambda$1(cancellableReadAction.kt:32)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:351)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:972)
	at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal$lambda$3$lambda$2(cancellableReadAction.kt:30)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:66)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:157)
	at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal(cancellableReadAction.kt:28)
	at com.intellij.openapi.application.rw.InternalReadAction.tryReadCancellable(InternalReadAction.kt:103)
	at com.intellij.openapi.application.rw.InternalReadAction.tryReadAction(InternalReadAction.kt:87)
	at com.intellij.openapi.application.rw.InternalReadAction.readLoop(InternalReadAction.kt:74)
	at com.intellij.openapi.application.rw.InternalReadAction.access$readLoop(InternalReadAction.kt:16)
	at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$6.invokeSuspend(InternalReadAction.kt:53)
	at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$6.invoke(InternalReadAction.kt)
	at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$6.invoke(InternalReadAction.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at com.intellij.openapi.application.rw.InternalReadAction.runReadAction(InternalReadAction.kt:49)
	at com.intellij.openapi.application.rw.PlatformReadWriteActionSupport.executeReadAction(PlatformReadWriteActionSupport.kt:38)
	at com.intellij.openapi.application.ReadWriteActionSupport.executeReadAction$default(ReadWriteActionSupport.kt:15)
	at com.intellij.openapi.application.CoroutinesKt.constrainedReadAction(coroutines.kt:62)
	at com.intellij.openapi.application.CoroutinesKt.readAction(coroutines.kt:29)
	at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewPopupUpdateProcessor$updatePopup$4.invokeSuspend(IntentionPreviewPopupUpdateProcessor.kt:125)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)


To Reproduce (*)

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior (*)

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Please complete the following information: (*)

  • OS: Linux 5.15.0-131-generic
  • PhpStorm/Intellij version: 2024.3.3
  • Plugin Version: 5.3.1

Additional context

Add any other context about the problem here.

Copy link

m2-assistant bot commented Feb 15, 2025

Hi @dipakp-logicrays. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

@VitaliyBoyko VitaliyBoyko changed the title Bug Report 2025/02/15 Must not start write action from within read action in the other thread Feb 15, 2025
@VitaliyBoyko VitaliyBoyko added good first issue Priority: P1 Needs to be fixed before any other issues labels Feb 15, 2025
@VitaliyBoyko VitaliyBoyko self-assigned this Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Priority: P1 Needs to be fixed before any other issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants