mapstruct-idea icon indicating copy to clipboard operation
mapstruct-idea copied to clipboard

Too many non-blocking read actions submitted at once.

Open vivekmore opened this issue 4 years ago • 5 comments

I got the following exception when I used the Ignore all unmapped target properties action

java.lang.Throwable: Too many non-blocking read actions submitted at once. Please use coalesceBy, BoundedTaskExecutor or another way of limiting the number of concurrently running threads.: 11 with similar stack traces are currently active
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:161)
	at com.intellij.openapi.application.impl.SubmissionTracker.preventTooManySubmissions(SubmissionTracker.java:45)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.<init>(NonBlockingReadActionImpl.java:231)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl.submit(NonBlockingReadActionImpl.java:191)
	at com.intellij.refactoring.suggested.SuggestedRefactoringChangeCollector.amendStateInBackground(SuggestedRefactoringChangeCollector.kt:94)
	at com.intellij.refactoring.suggested.SuggestedRefactoringChangeCollector.nextSignature(SuggestedRefactoringChangeCollector.kt:42)
	at com.intellij.refactoring.suggested.SuggestedRefactoringChangeListener$MyDocumentListener.performWhenAllCommitted(SuggestedRefactoringChangeListener.kt:288)
	at com.intellij.refactoring.suggested.SuggestedRefactoringChangeListener$MyDocumentListener.access$performWhenAllCommitted(SuggestedRefactoringChangeListener.kt:189)
	at com.intellij.refactoring.suggested.SuggestedRefactoringChangeListener$MyDocumentListener$documentChanged$1.invoke(SuggestedRefactoringChangeListener.kt:250)
	at com.intellij.refactoring.suggested.SuggestedRefactoringChangeListener$MyDocumentListener$documentChanged$1.invoke(SuggestedRefactoringChangeListener.kt:189)
	at com.intellij.refactoring.suggested.SuggestedRefactoringChangeListener$sam$java_lang_Runnable$0.run(SuggestedRefactoringChangeListener.kt)
	at com.intellij.psi.impl.PsiDocumentManagerBase.performWhenAllCommitted(PsiDocumentManagerBase.java:584)
	at com.intellij.psi.impl.PsiDocumentManagerBase.performWhenAllCommitted(PsiDocumentManagerBase.java:575)
	at com.intellij.refactoring.suggested.SuggestedRefactoringChangeListener$MyDocumentListener.documentChanged(SuggestedRefactoringChangeListener.kt:250)
	at jdk.internal.reflect.GeneratedMethodAccessor449.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.intellij.util.EventDispatcher.dispatchVoidMethod(EventDispatcher.java:123)
	at com.intellij.util.EventDispatcher.lambda$createMulticaster$1(EventDispatcher.java:86)
	at com.sun.proxy.$Proxy91.documentChanged(Unknown Source)
	at com.intellij.openapi.editor.impl.DocumentImpl.changedUpdate(DocumentImpl.java:916)
	at com.intellij.openapi.editor.impl.DocumentImpl.updateText(DocumentImpl.java:820)
	at com.intellij.openapi.editor.impl.DocumentImpl.replaceString(DocumentImpl.java:660)
	at com.intellij.openapi.editor.impl.DocumentImpl.replaceString(DocumentImpl.java:597)
	at com.intellij.psi.impl.PsiToDocumentSynchronizer.doCommitTransaction(PsiToDocumentSynchronizer.java:212)
	at com.intellij.psi.impl.PsiToDocumentSynchronizer.lambda$commitTransaction$1(PsiToDocumentSynchronizer.java:188)
	at com.intellij.psi.impl.PsiToDocumentSynchronizer.lambda$doSync$0(PsiToDocumentSynchronizer.java:106)
	at com.intellij.psi.impl.PsiToDocumentSynchronizer.performAtomically(PsiToDocumentSynchronizer.java:124)
	at com.intellij.psi.impl.PsiToDocumentSynchronizer.doSync(PsiToDocumentSynchronizer.java:106)
	at com.intellij.psi.impl.PsiToDocumentSynchronizer.commitTransaction(PsiToDocumentSynchronizer.java:188)
	at com.intellij.pom.core.impl.PomModelImpl.commitTransaction(PomModelImpl.java:197)
	at com.intellij.pom.core.impl.PomModelImpl.lambda$runTransaction$1(PomModelImpl.java:152)
	at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:567)
	at com.intellij.pom.core.impl.PomModelImpl.lambda$runTransaction$2(PomModelImpl.java:104)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:218)
	at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:93)
	at com.intellij.psi.impl.source.tree.ChangeUtil.prepareAndRunChangeAction(ChangeUtil.java:142)
	at com.intellij.psi.impl.source.tree.CompositeElement.addChild(CompositeElement.java:579)
	at com.intellij.psi.impl.source.tree.CompositeElement.addChildren(CompositeElement.java:673)
	at com.intellij.psi.impl.source.codeStyle.CodeEditUtil.addChildren(CodeEditUtil.java:53)
	at com.intellij.psi.impl.source.tree.CompositeElement.addInternal(CompositeElement.java:447)
	at com.intellij.psi.impl.source.tree.java.AnnotationParamListElement.addInternal(AnnotationParamListElement.java:104)
	at com.intellij.psi.impl.source.JavaStubPsiElement.addBefore(JavaStubPsiElement.java:63)
	at com.intellij.psi.impl.PsiImplUtil.setDeclaredAttributeValue(PsiImplUtil.java:506)
	at com.intellij.psi.impl.source.tree.java.PsiAnnotationImpl.setDeclaredAttributeValue(PsiAnnotationImpl.java:57)
	at com.intellij.codeInsight.intention.AddAnnotationPsiFix.addPhysicalAnnotationTo(AddAnnotationPsiFix.java:293)
	at com.intellij.codeInsight.intention.AddAnnotationPsiFix.addPhysicalAnnotation(AddAnnotationPsiFix.java:236)
	at org.mapstruct.intellij.util.MapstructAnnotationUtils.lambda$addMappingAnnotation$2(MapstructAnnotationUtils.java:101)
	at com.intellij.openapi.command.WriteCommandAction.lambda$runWriteCommandAction$4(WriteCommandAction.java:347)
	at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$1(WriteCommandAction.java:143)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:959)
	at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$2(WriteCommandAction.java:141)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:207)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:182)
	at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.doRunWriteCommandAction(WriteCommandAction.java:150)
	at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.run(WriteCommandAction.java:117)
	at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:347)
	at org.mapstruct.intellij.util.MapstructAnnotationUtils.runWriteCommandAction(MapstructAnnotationUtils.java:166)
	at org.mapstruct.intellij.util.MapstructAnnotationUtils.addMappingAnnotation(MapstructAnnotationUtils.java:91)
	at org.mapstruct.intellij.inspection.UnmappedTargetPropertiesInspection$UnmappedTargetPropertyFix.invoke(UnmappedTargetPropertiesInspection.java:238)
	at com.intellij.codeInspection.LocalQuickFixOnPsiElement.applyFix(LocalQuickFixOnPsiElement.java:100)
	at com.intellij.codeInspection.LocalQuickFixOnPsiElement.applyFix(LocalQuickFixOnPsiElement.java:90)
	at com.intellij.codeInspection.LocalQuickFixOnPsiElement.applyFix(LocalQuickFixOnPsiElement.java:22)
	at com.intellij.codeInspection.ex.QuickFixWrapper.invoke(QuickFixWrapper.java:78)
	at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.lambda$invoke$0(IntentionActionWithTextCaching.java:209)
	at com.intellij.util.SlowOperations.lambda$allowSlowOperations$0(SlowOperations.java:77)
	at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:64)
	at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:76)
	at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.invoke(IntentionActionWithTextCaching.java:209)
	at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$invokeIntention$4(ShowIntentionActionsHandler.java:251)
	at com.intellij.openapi.application.WriteAction.lambda$run$1(WriteAction.java:105)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:947)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:973)
	at com.intellij.openapi.application.WriteAction.run(WriteAction.java:104)
	at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.invokeIntention(ShowIntentionActionsHandler.java:251)
	at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$chooseActionAndInvoke$3(ShowIntentionActionsHandler.java:227)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:216)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:172)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:162)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:148)
	at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.chooseActionAndInvoke(ShowIntentionActionsHandler.java:226)
	at com.intellij.codeInsight.intention.impl.IntentionListStep.lambda$applyAction$3(IntentionListStep.java:135)
	at com.intellij.ide.IdeEventQueue.onFocusEvent(IdeEventQueue.java:569)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:486)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

vivekmore avatar May 19 '21 13:05 vivekmore

How many properties do you have that need to be ignored?

filiphr avatar May 19 '21 19:05 filiphr

In this particular instance there were 9

vivekmore avatar May 19 '21 20:05 vivekmore

Can you please tell me which IntelliJ version are you using?

Can you also reproduce this in standalone project and share the model with us?

I tried with 12 properties and it works without problems in IntelliJ IDEA 2021.1.2 Preview (Ultimate Edition)

filiphr avatar May 20 '21 16:05 filiphr

I don’t think it’s consistently reproducible. I’m using the latest stable version (ultimate 2021.1.1) at the time of this writing. 

vivekmore avatar May 21 '21 01:05 vivekmore

It's still buggy with idea 2021.2 and mapstruct-idea 1.3.0 I encountered this exception when I invoked "ignore all unmapped target properties" with 31 unmapped propeties. It should be easy to reproduce with too many unmapped propeties.

dragove avatar Aug 24 '21 09:08 dragove