mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
[maven] [IDEA-352679] more logging - still waiting for lock
GitOrigin-RevId: 589ab4c0651ed8d47f4094d4642be6a46cf0e02a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
31cd9e69fd
commit
f93f2d097a
@@ -33,6 +33,7 @@ import com.intellij.util.ExceptionUtil
|
||||
import com.intellij.util.concurrency.annotations.RequiresBackgroundThread
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import org.jetbrains.concurrency.AsyncPromise
|
||||
import org.jetbrains.idea.maven.buildtool.MavenDownloadConsole
|
||||
@@ -304,23 +305,14 @@ open class MavenProjectsManagerEx(project: Project, private val cs: CoroutineSco
|
||||
}
|
||||
|
||||
private suspend fun <T> updateMavenProjectsUnderLock(update: suspend () -> List<T>): List<T> {
|
||||
val lockSucceed = importMutex.tryLock()
|
||||
try {
|
||||
if (MavenLog.LOG.isDebugEnabled) {
|
||||
MavenLog.LOG.debug("Update maven requested. lock=${lockSucceed}, coroutines dump: ${dumpCoroutines()}")
|
||||
}
|
||||
if (lockSucceed) {
|
||||
return update()
|
||||
}
|
||||
else {
|
||||
MavenLog.LOG.info("Maven import is already in progress")
|
||||
return emptyList()
|
||||
}
|
||||
val time = System.currentTimeMillis();
|
||||
if (MavenLog.LOG.isDebugEnabled) {
|
||||
MavenLog.LOG.debug("Update maven requested in $time. Coroutines dump: ${dumpCoroutines()}")
|
||||
}
|
||||
finally {
|
||||
if (lockSucceed) {
|
||||
importMutex.unlock()
|
||||
}
|
||||
|
||||
importMutex.withLock {
|
||||
MavenLog.LOG.debug("Update maven started.Time = $time")
|
||||
return update()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,9 +445,9 @@ open class MavenProjectsManagerEx(project: Project, private val cs: CoroutineSco
|
||||
|
||||
}
|
||||
|
||||
private suspend fun MavenProjectsManagerEx.resolveMavenProjects(syncActivity: StructuredIdeActivity,
|
||||
projectsToResolve: Collection<MavenProject>,
|
||||
spec: MavenSyncSpec): MavenProjectResolutionResult {
|
||||
private suspend fun resolveMavenProjects(syncActivity: StructuredIdeActivity,
|
||||
projectsToResolve: Collection<MavenProject>,
|
||||
spec: MavenSyncSpec): MavenProjectResolutionResult {
|
||||
logDebug("importModules started: ${projectsToResolve.size}")
|
||||
val resolver = MavenProjectResolver(project)
|
||||
val resolutionResult = withBackgroundProgressTraced(myProject, MavenProjectBundle.message("maven.resolving"), true) {
|
||||
|
||||
@@ -31,10 +31,7 @@ import com.intellij.openapi.vfs.VirtualFileManager
|
||||
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess
|
||||
import com.intellij.psi.codeStyle.CodeStyleSchemes
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings
|
||||
import com.intellij.testFramework.CodeStyleSettingsTracker
|
||||
import com.intellij.testFramework.IdeaTestUtil
|
||||
import com.intellij.testFramework.IndexingTestUtil
|
||||
import com.intellij.testFramework.PlatformTestUtil
|
||||
import com.intellij.testFramework.*
|
||||
import com.intellij.testFramework.RunAll.Companion.runAll
|
||||
import com.intellij.util.ThrowableRunnable
|
||||
import com.intellij.util.concurrency.annotations.RequiresBackgroundThread
|
||||
|
||||
Reference in New Issue
Block a user