do not log CE

GitOrigin-RevId: eaab0c6ccf6ee8fbbad8add5770215091029d641
This commit is contained in:
Vladimir Krivosheev
2023-07-27 06:32:48 +02:00
committed by intellij-monorepo-bot
parent 8c2b662893
commit c6f738ce42
3 changed files with 9 additions and 1 deletions

View File

@@ -5,12 +5,14 @@ package org.jetbrains.intellij.build.devServer
import com.intellij.openapi.application.PathManager
import com.intellij.platform.diagnostic.telemetry.BatchSpanProcessor
import com.intellij.util.childScope
import io.opentelemetry.api.common.Attributes
import io.opentelemetry.sdk.OpenTelemetrySdk
import io.opentelemetry.sdk.resources.Resource
import io.opentelemetry.sdk.trace.SdkTracerProvider
import io.opentelemetry.semconv.resource.attributes.ResourceAttributes
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.cancel
import kotlinx.coroutines.runBlocking
import org.jetbrains.intellij.build.ConsoleSpanExporter
import org.jetbrains.intellij.build.TracerProviderManager
@@ -27,7 +29,8 @@ fun buildDevMain(): Collection<Path> {
var homePath: String? = null
var newClassPath: Collection<Path>? = null
runBlocking(Dispatchers.Default) {
val spanProcessor = BatchSpanProcessor(coroutineScope = this, spanExporters = listOf(ConsoleSpanExporter()))
val batchSpanProcessorScope = childScope()
val spanProcessor = BatchSpanProcessor(coroutineScope = batchSpanProcessorScope, spanExporters = listOf(ConsoleSpanExporter()))
val tracerProvider = SdkTracerProvider.builder()
.addSpanProcessor(spanProcessor)
@@ -61,6 +64,7 @@ fun buildDevMain(): Collection<Path> {
))
}
finally {
batchSpanProcessorScope.cancel()
traceManagerInitializer = { throw IllegalStateException("already built") }
}
}

View File

@@ -98,6 +98,7 @@ suspend fun runApplicationStarter(context: BuildContext,
BuildUtils.addVmProperty(jvmArgs, "idea.config.path", "$tempDir/config")
// reproducible build - avoid touching module outputs, do no write classpath.index
BuildUtils.addVmProperty(jvmArgs, "idea.classpath.index.enabled", "false")
BuildUtils.addVmProperty(jvmArgs, "idea.builtin.server.disabled", "true")
BuildUtils.addVmProperty(jvmArgs, "java.system.class.loader", "com.intellij.util.lang.PathClassLoader")
BuildUtils.addVmProperty(jvmArgs, "idea.platform.prefix", context.productProperties.platformPrefix)
jvmArgs.addAll(BuildUtils.propertiesToJvmArgs(systemProperties.entries.map { it.key to it.value.toString() }))

View File

@@ -121,6 +121,9 @@ class BuiltInServerManagerImpl(private val coroutineScope: CoroutineScope) : Bui
server = BuiltInServer.start(firstPort = defaultPort, portsCount = PORTS_COUNT, tryAnyPort = true)
bindCustomPorts(server!!)
}
catch (e: CancellationException) {
return
}
catch (e: Throwable) {
LOG.info(e)
val message = BuiltInServerBundle.message("notification.content.cannot.start.internal.http.server.and.ask.for.restart.0",