You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Fatal Error appeared while editing code (not envolving pydantic models, but they're present in some imported modules)
To Reproduce
I did nothing related to Pydantic
Expected behavior
Expected not to receive fatal errors
Screenshots
Environments
IDE: PyCharm 2021.1.3 (Professional Edition) Build #PY-211.7628.24, built on June 30, 2021
OS: macOS Big Sur 11.4 (20F71)
Pydantic Version 1.8.2
Plugin version 0.3.5
Additional context
Logs:
java.lang.Throwable: Non-idempotent computation: it returns different results when invoked multiple times or on different threads:
1 != 2
which is length of [PyTargetExpression: dialect@0] and [PyTargetExpression: dialect@0, PyTargetExpression: dialect@0]
Recomputation gives [Lcom.intellij.psi.ResolveResult;@8c05c37 (class [Lcom.intellij.psi.ResolveResult;) which is equivalent to 'fresh'
Recomputation log:
Resolving PyQualifiedReference(PyReferenceExpression: dialect,com.jetbrains.python.psi.resolve.PyResolveContext@ed11a5b1) of class com.jetbrains.python.psi.impl.references.PyQualifiedReference
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:161)
at com.intellij.util.IdempotenceChecker.reportFailure(IdempotenceChecker.java:90)
at com.intellij.util.IdempotenceChecker.checkEquivalence(IdempotenceChecker.java:77)
at com.intellij.psi.impl.source.resolve.ResolveCache.cache(ResolveCache.java:322)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:249)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:154)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:169)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:162)
at com.jetbrains.python.psi.impl.references.PyReferenceImpl.multiResolve(PyReferenceImpl.java:95)
at com.jetbrains.python.psi.PyUtil.multiResolveTopPriority(PyUtil.java:514)
at com.jetbrains.python.codeInsight.typing.PyTypingTypeProvider.tryResolvingWithAliases(PyTypingTypeProvider.java:1383)
at com.jetbrains.python.codeInsight.typing.PyTypingTypeProvider.tryResolving(PyTypingTypeProvider.java:1372)
at com.jetbrains.python.codeInsight.typing.PyTypingTypeProvider.resolveToQualifiedNames(PyTypingTypeProvider.java:1438)
at com.jetbrains.python.codeInsight.typing.PyTypedDictTypeProvider$Companion.isTypedDict(PyTypedDictTypeProvider.kt:42)
at com.jetbrains.python.codeInsight.typing.PyTypedDictTypeProvider$Companion.getTypedDictTypeForCallee(PyTypedDictTypeProvider.kt:111)
at com.jetbrains.python.codeInsight.typing.PyTypedDictTypeProvider$Companion.access$getTypedDictTypeForCallee(PyTypedDictTypeProvider.kt:38)
at com.jetbrains.python.codeInsight.typing.PyTypedDictTypeProvider.getReferenceExpressionType(PyTypedDictTypeProvider.kt:27)
at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getTypeFromProviders(PyReferenceExpressionImpl.java:385)
at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getType(PyReferenceExpressionImpl.java:219)
at com.jetbrains.python.psi.types.TypeEvalContext.lambda$getType$0(TypeEvalContext.java:180)
at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:111)
at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:43)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:68)
at com.jetbrains.python.psi.types.TypeEvalContext.getType(TypeEvalContext.java:169)
at com.koxudaxi.pydantic.PydanticKt.getType(Pydantic.kt:123)
at com.koxudaxi.pydantic.PydanticKt.getPyClassByPyCallExpression(Pydantic.kt:131)
at com.koxudaxi.pydantic.PydanticKt.getPydanticPyClass(Pydantic.kt:466)
at com.koxudaxi.pydantic.PydanticInspection$Visitor.inspectPydanticModelCallableExpression(PydanticInspection.kt:84)
at com.koxudaxi.pydantic.PydanticInspection$Visitor.visitPyCallExpression(PydanticInspection.kt:54)
at com.jetbrains.python.psi.impl.PyCallExpressionImpl.acceptPyVisitor(PyCallExpressionImpl.java:29)
at com.jetbrains.python.psi.impl.PyBaseElementImpl.accept(PyBaseElementImpl.java:69)
at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:65)
at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:56)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.runToolOnElements(LocalInspectionsPass.java:320)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$4(LocalInspectionsPass.java:279)
at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:161)
at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:153)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$5(LocalInspectionsPass.java:277)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:132)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:121)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$6(LocalInspectionsPass.java:277)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:136)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1096)
at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:92)
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.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:104)
at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:83)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:167)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:178)
at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:83)
at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
The text was updated successfully, but these errors were encountered:
@mahenzon
I'm sorry for my too-late fix.
I have released a new version v0.4.0 in the market
The version dropped unnecessary resolving for an object reference.
It means the update reduces CPU load and fixes unexpected errors.
I closed the PR because the root cause method was removed from the plugin's source code.
Thank you.
Describe the bug
Fatal Error appeared while editing code (not envolving pydantic models, but they're present in some imported modules)
To Reproduce
I did nothing related to Pydantic
Expected behavior
Expected not to receive fatal errors
Screenshots
Environments
Additional context
Logs:
The text was updated successfully, but these errors were encountered: