mirror of
https://github.com/corda/corda.git
synced 2025-01-11 15:32:49 +00:00
Merge pull request #778 from corda/aslemmer-merge-88c12791a81a49bdaab93e6bda4d070d7bf1ac5c
Aslemmer merge 88c12791a8
This commit is contained in:
commit
d2b6978d90
Binary file not shown.
Before Width: | Height: | Size: 339 KiB After Width: | Height: | Size: 238 KiB |
@ -108,7 +108,7 @@ class DBTransactionStorage(cacheSizeBytes: Long) : WritableTransactionStorage, S
|
||||
|
||||
override fun track(): DataFeed<List<SignedTransaction>, SignedTransaction> {
|
||||
return txStorage.exclusive {
|
||||
DataFeed(allPersisted().map { it.second.toSignedTx() }.toList(), updates.bufferUntilSubscribed().wrapWithDatabaseTransaction())
|
||||
DataFeed(allPersisted().map { it.second.toSignedTx() }.toList(), updates.bufferUntilSubscribed())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,7 @@ import net.corda.nodeapi.internal.persistence.contextTransaction
|
||||
import net.corda.nodeapi.internal.persistence.contextTransactionOrNull
|
||||
import org.slf4j.Logger
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.slf4j.MDC
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.reflect.KProperty1
|
||||
|
||||
@ -174,11 +175,16 @@ class FlowStateMachineImpl<R>(override val id: StateMachineRunId,
|
||||
}
|
||||
}
|
||||
|
||||
fun setLoggingContext() {
|
||||
context.pushToLoggingContext()
|
||||
MDC.put("flow-id", id.uuid.toString())
|
||||
}
|
||||
|
||||
@Suspendable
|
||||
override fun run() {
|
||||
logic.stateMachine = this
|
||||
|
||||
context.pushToLoggingContext()
|
||||
setLoggingContext()
|
||||
|
||||
initialiseFlow()
|
||||
|
||||
@ -331,6 +337,7 @@ class FlowStateMachineImpl<R>(override val id: StateMachineRunId,
|
||||
require(continuation == FlowContinuation.ProcessEvents)
|
||||
Fiber.unparkDeserialized(this, scheduler)
|
||||
}
|
||||
setLoggingContext()
|
||||
return uncheckedCast(processEventsUntilFlowIsResumed(
|
||||
isDbTransactionOpenOnEntry = false,
|
||||
isDbTransactionOpenOnExit = true
|
||||
|
Loading…
Reference in New Issue
Block a user