[tcp-eel] IJPL-209592: TcpEelMachine: fix endless connections in case of error

GitOrigin-RevId: 840dc02384608fd73a8b8d68e06519cb2ed62214
This commit is contained in:
Andrii Zinchenko
2026-01-13 16:42:34 +00:00
committed by intellij-monorepo-bot
parent bd7bee6d29
commit 22eef74546
+9 -1
View File
@@ -7,6 +7,7 @@ import com.intellij.platform.eel.EelMachine
import com.intellij.platform.ijent.IjentApi
import com.intellij.platform.ijent.IjentSession
import com.intellij.platform.ijent.tcp.IjentIsolatedTcpDeployingStrategy
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.async
@@ -49,7 +50,14 @@ abstract class TcpEelMachine(
fun deploy() {
if (deployingState.compareAndSet(false, true)) {
coroutineScope.async {
deferredEelSession.complete(strategyFactory().createIjentSession())
try {
deferredEelSession.complete(strategyFactory().createIjentSession())
}
catch (e: Throwable) {
deferredEelSession.completeExceptionally(e)
if (e is CancellationException) throw e
}
}
}
}