Bug P3
Status Update
Comments
ya...@google.com <ya...@google.com> #2
ya...@google.com <ya...@google.com> #3
Groovy Gradle?
ra...@google.com <ra...@google.com> #4
UI thread waiting to acquire the write lock, the read lock is being held by the following thread, which is also waiting on another lock in scripting support:
"ApplicationImpl pooled thread 8" #162 [166403] prio=4 os_prio=31 cpu=348.69ms elapsed=198.20s tid=0x0000000133121a00 nid=166403 runnable [0x00000004185f9000]
java.lang.Thread.State: TIMED_WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@21.0.3/Native Method)
- parking to wait for <0x000000061f5ab9f0> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
at java.util.concurrent.locks.LockSupport.parkNanos(java.base@21.0.3/Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@21.0.3/Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireNanos(java.base@21.0.3/Unknown Source)
at java.util.concurrent.locks.ReentrantLock$Sync.tryLockNanos(java.base@21.0.3/Unknown Source)
at java.util.concurrent.locks.ReentrantLock.tryLock(java.base@21.0.3/Unknown Source)
at org.jetbrains.kotlin.idea.core.script.ucache.ScriptClassRootsUpdater.invalidate(ScriptClassRootsUpdater.kt:381)
at org.jetbrains.kotlin.idea.core.script.configuration.DefaultScriptingSupportBase.setAppliedConfiguration(DefaultScriptingSupport.kt:493)
at org.jetbrains.kotlin.idea.core.script.configuration.DefaultScriptingSupport.suggestOrSaveConfiguration(DefaultScriptingSupport.kt:289)
at org.jetbrains.kotlin.idea.core.script.configuration.DefaultScriptingSupport.access$suggestOrSaveConfiguration(DefaultScriptingSupport.kt:88)
at org.jetbrains.kotlin.idea.core.script.configuration.DefaultScriptingSupport$loadingContext$1.saveNewConfiguration(DefaultScriptingSupport.kt:252)
at org.jetbrains.kotlin.idea.core.script.configuration.cache.ScriptConfigurationFileAttributeCache.loadDependencies(ScriptConfigurationFileAttributeCache.kt:45)
at org.jetbrains.kotlin.idea.core.script.configuration.DefaultScriptingSupport.reloadOutOfDateConfiguration(DefaultScriptingSupport.kt:168)
at org.jetbrains.kotlin.idea.core.script.configuration.DefaultScriptingSupportBase.reloadOutOfDateConfiguration$default(DefaultScriptingSupport.kt:392)
at org.jetbrains.kotlin.idea.core.script.configuration.DefaultScriptingSupportBase$reloadIfOutOfDate$1$1$1.invoke(DefaultScriptingSupport.kt:443)
at org.jetbrains.kotlin.idea.core.script.configuration.DefaultScriptingSupportBase$reloadIfOutOfDate$1$1$1.invoke(DefaultScriptingSupport.kt:442)
at com.intellij.openapi.application.ActionsKt.runReadAction$lambda$3(actions.kt:31)
at com.intellij.openapi.application.ActionsKt$$Lambda/0x0000000800f04048.compute(Unknown Source)
at com.intellij.openapi.application.impl.RwLockHolder.runReadAction(RwLockHolder.kt:271)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:845)
at com.intellij.openapi.application.ActionsKt.runReadAction(actions.kt:31)
at org.jetbrains.kotlin.idea.core.script.configuration.DefaultScriptingSupportBase.reloadIfOutOfDate(DefaultScriptingSupport.kt:442)
at org.jetbrains.kotlin.idea.core.script.configuration.DefaultScriptingSupportBase.ensureUpToDatedConfigurationSuggested(DefaultScriptingSupport.kt:434)
at org.jetbrains.kotlin.idea.core.script.configuration.DefaultScriptingSupportBase.ensureUpToDatedConfigurationSuggested$default(DefaultScriptingSupport.kt:433)
at org.jetbrains.kotlin.idea.core.script.configuration.listener.DefaultScriptChangeListener.editorActivated(DefaultScriptChangeListener.kt:11)
at org.jetbrains.kotlin.idea.core.script.configuration.listener.ScriptChangesNotifier.updateScriptDependenciesIfNeeded$kotlin_base_scripting(ScriptChangesNotifier.kt:94)
at org.jetbrains.kotlin.idea.core.script.configuration.listener.ScriptChangesNotifier$1.runScriptDependenciesUpdateIfNeeded$lambda$1(ScriptChangesNotifier.kt:46)
at org.jetbrains.kotlin.idea.core.script.configuration.listener.ScriptChangesNotifier$1$$Lambda/0x0000000801923508.run(Unknown Source)
...
Locked ownable synchronizers:
- <0x000000061f5ac020> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
- <0x00000007f9b7bb18> (a java.util.concurrent.ThreadPoolExecutor$Worker)
and
"ApplicationImpl pooled thread 7" #161 [142595] prio=4 os_prio=31 cpu=2640.83ms elapsed=198.20s tid=0x000000040bcaca00 nid=142595 runnable [0x00000004183ed000]
java.lang.Thread.State: TIMED_WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@21.0.3/Native Method)
- parking to wait for <0x0000000605221440> (a com.intellij.openapi.application.impl.ReadMostlyRWLock)
at java.util.concurrent.locks.LockSupport.parkNanos(java.base@21.0.3/Unknown Source)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.waitABit(ReadMostlyRWLock.java:162)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.startRead(ReadMostlyRWLock.java:126)
at com.intellij.openapi.application.impl.RwLockHolder.runReadAction(RwLockHolder.kt:268)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:845)
at com.intellij.openapi.application.ActionsKt.runReadAction(actions.kt:31)
at org.jetbrains.kotlin.idea.core.script.ucache.ScriptClassRootsCache.getHeavyScriptInfo(ScriptClassRootsCache.kt:86)
at org.jetbrains.kotlin.idea.core.script.ucache.ScriptClassRootsCache.getScriptDependenciesClassFiles(ScriptClassRootsCache.kt:161)
at org.jetbrains.kotlin.idea.core.script.configuration.CompositeScriptConfigurationManager.getScriptDependenciesClassFiles(CompositeScriptConfigurationManager.kt:197)
at org.jetbrains.kotlin.idea.core.script.ucache.KotlinScriptEntitiesKt.getActualScriptLibraries(kotlinScriptEntities.kt:293)
at org.jetbrains.kotlin.idea.core.script.ucache.KotlinScriptEntitiesKt.syncScriptEntities(kotlinScriptEntities.kt:194)
at org.jetbrains.kotlin.idea.core.script.ucache.KotlinScriptEntitiesKt.syncScriptEntities(kotlinScriptEntities.kt:66)
at org.jetbrains.kotlin.idea.core.script.ucache.ScriptClassRootsUpdater.applyDiffToModel(ScriptClassRootsUpdater.kt:298)
at org.jetbrains.kotlin.idea.core.script.ucache.ScriptClassRootsUpdater.applyDiffToModelAsync(ScriptClassRootsUpdater.kt:282)
at org.jetbrains.kotlin.idea.core.script.ucache.ScriptClassRootsUpdater.doUpdate(ScriptClassRootsUpdater.kt:249)
at org.jetbrains.kotlin.idea.core.script.ucache.ScriptClassRootsUpdater.updateSynchronously(ScriptClassRootsUpdater.kt:209)
at org.jetbrains.kotlin.idea.core.script.ucache.ScriptClassRootsUpdater.performUpdate(ScriptClassRootsUpdater.kt:190)
at org.jetbrains.kotlin.idea.core.script.ucache.ScriptClassRootsUpdater.scheduleUpdateIfInvalid(ScriptClassRootsUpdater.kt:178)
at org.jetbrains.kotlin.idea.core.script.ucache.ScriptClassRootsUpdater.commit(ScriptClassRootsUpdater.kt:158)
at org.jetbrains.kotlin.idea.core.script.configuration.DefaultScriptingSupportBase.reloadIfOutOfDate(DefaultScriptingSupport.kt:570)
at org.jetbrains.kotlin.idea.core.script.configuration.DefaultScriptingSupportBase.ensureUpToDatedConfigurationSuggested(DefaultScriptingSupport.kt:434)
at org.jetbrains.kotlin.idea.core.script.configuration.DefaultScriptingSupportBase.ensureUpToDatedConfigurationSuggested$default(DefaultScriptingSupport.kt:433)
at org.jetbrains.kotlin.idea.core.script.configuration.listener.DefaultScriptChangeListener.editorActivated(DefaultScriptChangeListener.kt:11)
at org.jetbrains.kotlin.idea.core.script.configuration.listener.ScriptChangesNotifier.updateScriptDependenciesIfNeeded$kotlin_base_scripting(ScriptChangesNotifier.kt:94)
at org.jetbrains.kotlin.idea.core.script.configuration.listener.ScriptChangesNotifier$1.runScriptDependenciesUpdateIfNeeded$lambda$1(ScriptChangesNotifier.kt:46)
at org.jetbrains.kotlin.idea.core.script.configuration.listener.ScriptChangesNotifier$1$$Lambda/0x0000000801923508.run(Unknown Source)
...
Locked ownable synchronizers:
- <0x000000061f52e130> (a java.util.concurrent.ThreadPoolExecutor$Worker)
- <0x000000061f5ab9f0> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
bu...@google.com <bu...@google.com> #6
Hi. I've received your bug and will wait for https://youtrack.jetbrains.com/issue/KTIJ-27482 to be resolved and then unassign the bug.
Description
Write action on the UI thread is blocked by read action executed on a background thread 'Alarm Pool, TID: 1043'.
The frame that is likely responsible for the freeze is org.jetbrains.kotlin.org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137).
It calls 'sun.security.ssl.SSLSocketImpl$AppInputStream.read(Unknown Source)' that takes about 40700ms.
Call context:
org.jetbrains.kotlin.org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
org.jetbrains.kotlin.org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280)
org.jetbrains.kotlin.org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153)
==> org.jetbrains.kotlin.org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137) <==
sun.security.ssl.SSLSocketImpl$AppInputStream.read(Unknown Source)
Signature: freeze:org.jetbrains.kotlin.org.apache.http.impl.io.SessionInputBufferImpl.streamRead-be87764c
Attached a thread dump. Sometimes it happens on startup, sometimes just randomly after normal use. Attached dump is from startup
Studio Build: AS Ladybug Canary 3
Version of Gradle Plugin: 8.5.1
Version of Gradle: 8.9
Version of Java: 21
OS: macOS Sonoma