From 901b99b56917f0bcdaf6442308c18eb2fdec15e4 Mon Sep 17 00:00:00 2001 From: "Maxim.Kolmakov" Date: Wed, 4 Sep 2024 22:14:18 +0200 Subject: [PATCH] IJPL-160781 DevServer sometimes takes 4+ minutes to build plugin Let's try to remove all additional and not essential logging. Hypothesis: We might output too much messages to TC which leads to buffers overflow and the total freezes of tests. GitOrigin-RevId: a58bd9cc890781f2bf381dd4bff24163d9dc1cc5 --- .../org/jetbrains/intellij/build/telemetry/span.kt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/build/tasks/src/org/jetbrains/intellij/build/telemetry/span.kt b/build/tasks/src/org/jetbrains/intellij/build/telemetry/span.kt index 5cb0afbb5e81..3d90d17bc8f1 100644 --- a/build/tasks/src/org/jetbrains/intellij/build/telemetry/span.kt +++ b/build/tasks/src/org/jetbrains/intellij/build/telemetry/span.kt @@ -9,7 +9,6 @@ import io.opentelemetry.extension.kotlin.asContextElement import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.withContext import org.jetbrains.annotations.ApiStatus.Internal -import org.jetbrains.intellij.build.logging.TeamCityBuildMessageLogger import org.jetbrains.intellij.build.telemetry.TraceManager.spanBuilder import kotlin.coroutines.CoroutineContext import kotlin.coroutines.EmptyCoroutineContext @@ -28,10 +27,8 @@ suspend fun SpanBuilder.block( TraceManager.scheduleExportPendingSpans() return startSpan().useWithoutActiveScope { span -> // see `use` below why `withContext` must be inner - TeamCityBuildMessageLogger.withBlock(span) { - withContext(Context.current().with(span).asContextElement() + coroutineContext) { - operation(span) - } + withContext(Context.current().with(span).asContextElement() + coroutineContext) { + operation(span) } } } @@ -47,10 +44,8 @@ suspend inline fun SpanBuilder.use( return startSpan().useWithoutActiveScope { span -> // inner `withContext` to ensure that we report the end of the span only when all child tasks are completed, // the same for `withFlow` - must be out of `withContext` - TeamCityBuildMessageLogger.withFlow(span) { - withContext(Context.current().with(span).asContextElement() + context) { + withContext(Context.current().with(span).asContextElement() + context) { operation(span) - } } } } \ No newline at end of file