From 009f9c8f3866fa30d6c0e0e6f0211241a7acaa37 Mon Sep 17 00:00:00 2001 From: Anastasia Katsman Date: Tue, 7 Oct 2025 16:36:35 +0200 Subject: [PATCH] [starter] LocalEventsFlow: use one runBlocking instead of many GitOrigin-RevId: 1cb19330ba10e30a3b4f8935bf4b9d930174b508 --- .../tools/ide/starter/bus/local/LocalEventsFlow.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/performanceTesting/event-bus/src/com/intellij/tools/ide/starter/bus/local/LocalEventsFlow.kt b/plugins/performanceTesting/event-bus/src/com/intellij/tools/ide/starter/bus/local/LocalEventsFlow.kt index 579c8b035b80..7a25ce4c1963 100644 --- a/plugins/performanceTesting/event-bus/src/com/intellij/tools/ide/starter/bus/local/LocalEventsFlow.kt +++ b/plugins/performanceTesting/event-bus/src/com/intellij/tools/ide/starter/bus/local/LocalEventsFlow.kt @@ -116,15 +116,18 @@ class LocalEventsFlow : EventsFlow { } return@map result } - ?.forEach { + runBlocking { + // awaitAll shouldn't be used as it would stop after the first exception from any coroutine + tasks?.forEach { try { - runBlocking { it.await() } + it.await() } catch (e: Throwable) { LOG.info("Exception occurred while processing $e") exceptions.add(e) } } + } LOG.debug("All exceptions: $exceptions") if (exceptions.isNotEmpty()) {