MCPcopy Create free account
hub / github.com/temporalio/temporal / assertNotCurrentExecution

Function assertNotCurrentExecution

common/persistence/sql/execution_util.go:940–964  ·  view source on GitHub ↗
(
	ctx context.Context,
	tx sqlplugin.Tx,
	shardID int32,
	namespaceID primitives.UUID,
	workflowID string,
	runID primitives.UUID,
	archetypeID chasm.ArchetypeID,
	serializer serialization.Serializer,
)

Source from the content-addressed store, hash-verified

938}
939
940func assertNotCurrentExecution(
941 ctx context.Context,
942 tx sqlplugin.Tx,
943 shardID int32,
944 namespaceID primitives.UUID,
945 workflowID string,
946 runID primitives.UUID,
947 archetypeID chasm.ArchetypeID,
948 serializer serialization.Serializer,
949) error {
950 currentRow, err := tx.LockCurrentExecutions(ctx, sqlplugin.CurrentExecutionsFilter{
951 ShardID: shardID,
952 NamespaceID: namespaceID,
953 WorkflowID: workflowID,
954 ArchetypeID: archetypeID,
955 })
956 if err != nil {
957 if err == sql.ErrNoRows {
958 // allow bypassing no current record
959 return nil
960 }
961 return serviceerror.NewUnavailablef("assertCurrentExecution failed. Unable to load current record. Error: %v", err)
962 }
963 return assertRunIDMismatch(runID, currentRow, serializer)
964}
965
966func assertRunIDAndUpdateCurrentExecution(
967 ctx context.Context,

Calls 2

assertRunIDMismatchFunction · 0.85
LockCurrentExecutionsMethod · 0.65

Tested by

no test coverage detected