From 5fef0726a2c54107a0cd6ea08753f571ae65039a Mon Sep 17 00:00:00 2001 From: Kyriakos Tharrouniatis Date: Mon, 20 Jul 2020 15:09:26 +0100 Subject: [PATCH] Add missing 'Suspendable' annotations to suspending methods (#6480) --- .../net/corda/node/services/statemachine/ActionExecutorImpl.kt | 2 ++ .../corda/node/services/statemachine/ActionFutureExecutor.kt | 3 +++ 2 files changed, 5 insertions(+) diff --git a/node/src/main/kotlin/net/corda/node/services/statemachine/ActionExecutorImpl.kt b/node/src/main/kotlin/net/corda/node/services/statemachine/ActionExecutorImpl.kt index 2849dc03a1..435ae5d6f3 100644 --- a/node/src/main/kotlin/net/corda/node/services/statemachine/ActionExecutorImpl.kt +++ b/node/src/main/kotlin/net/corda/node/services/statemachine/ActionExecutorImpl.kt @@ -73,6 +73,7 @@ internal class ActionExecutorImpl( if (action.uuid != null) services.vaultService.softLockRelease(action.uuid) } + @Suspendable private fun executeTrackTransaction(fiber: FlowFiber, action: Action.TrackTransaction) { actionFutureExecutor.awaitTransaction(fiber, action) } @@ -223,6 +224,7 @@ internal class ActionExecutorImpl( } @Suppress("TooGenericExceptionCaught") + @Suspendable private fun executeAsyncOperation(fiber: FlowFiber, action: Action.ExecuteAsyncOperation) { try { actionFutureExecutor.awaitAsyncOperation(fiber, action) diff --git a/node/src/main/kotlin/net/corda/node/services/statemachine/ActionFutureExecutor.kt b/node/src/main/kotlin/net/corda/node/services/statemachine/ActionFutureExecutor.kt index dc5d2fc0b9..40ee343707 100644 --- a/node/src/main/kotlin/net/corda/node/services/statemachine/ActionFutureExecutor.kt +++ b/node/src/main/kotlin/net/corda/node/services/statemachine/ActionFutureExecutor.kt @@ -1,5 +1,6 @@ package net.corda.node.services.statemachine +import co.paralleluniverse.fibers.Suspendable import net.corda.core.internal.concurrent.thenMatch import net.corda.core.utilities.contextLogger import net.corda.core.utilities.debug @@ -45,6 +46,7 @@ internal class ActionFutureExecutor( * @param fiber The [FlowFiber] to resume after completing the async operation * @param action The [Action.ExecuteAsyncOperation] to create a future from */ + @Suspendable fun awaitAsyncOperation(fiber: FlowFiber, action: Action.ExecuteAsyncOperation) { cancelFutureIfRunning(fiber, action.currentState) val instance = fiber.instanceId @@ -63,6 +65,7 @@ internal class ActionFutureExecutor( * @param fiber The [FlowFiber] to resume after the committing the specified transaction * @param action [Action.TrackTransaction] contains the transaction hash to wait for */ + @Suspendable fun awaitTransaction(fiber: FlowFiber, action: Action.TrackTransaction) { cancelFutureIfRunning(fiber, action.currentState) val instance = fiber.instanceId