}
return ms.chasmTree.ArchetypeID() == chasm.WorkflowArchetypeID
}
func (ms *MutableStateImpl) HSM() *hsm.Node {
Frontier kind: Code frontier
unlabeled · c_f680a39613c7
321 tests · 3967 LOC · 164 files · introduces 0 tests · 92 LOC · 3 files
The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.
Introduced files, introduced tests, and structurally relevant concept specialization
In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.
Graph controls are ready.
Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.
Every exact file and test below is linked only from the concept that introduces it.
go.temporal.io/server/common/persistence/client/TestQuotasSuite/TestAPITypeCallOriginPriorityOverrideMappinggo.temporal.io/server/common/persistence/client/TestQuotasSuite/TestBackgroundTypeAPIPriorityOverrideMappinggo.temporal.io/server/common/persistence/client/TestQuotasSuite/TestCallerTypeDefaultPriorityMappinggo.temporal.io/server/common/persistence/client/TestQuotasSuite/TestRequestPrioritiesOrderedgo.temporal.io/server/common/circuitbreaker/TestTSCBWithDynamicSettingsgo.temporal.io/server/common/dynamicconfig/TestDeepCopy_OtherReferenceTypes_Nilgo.temporal.io/server/service/matching/configs/TestQuotasSuite/TestAPIPrioritiesOrderedgo.temporal.io/server/service/matching/configs/TestQuotasSuite/TestAPIToPriorityMappinggo.temporal.io/server/common/namespace/TestDefaultReplicationResolver_FailoverVersion/negative_versiongo.temporal.io/server/common/namespace/TestDefaultReplicationResolver_FailoverVersion/positive_versiongo.temporal.io/server/common/namespace/TestDefaultReplicationResolver_FailoverVersion/zero_versiongo.temporal.io/server/common/metrics/TestTagsCacheKey/different_keysgo.temporal.io/server/common/metrics/TestTagsCacheKey/different_orderinggo.temporal.io/server/common/metrics/TestTagsCacheKey/different_valuesgo.temporal.io/server/common/metrics/TestTagsCacheKey/identical_multi_tagsgo.temporal.io/server/common/metrics/TestTagsCacheKey/identical_single_tagsgo.temporal.io/server/common/metrics/TestTagsCacheKey/key_boundary_ambiguitygo.temporal.io/server/common/metrics/TestTagsCacheKey/single_vs_multigo.temporal.io/server/common/metrics/TestTagsCacheKey_NoCollisionsForEmbeddedNullsEvery collected test enters the hierarchy at exactly one concept.
No tests are introduced at this concept. Its intent tests are introduced by other concepts.
Every collected source range enters the hierarchy at exactly one concept.
3 files ranked by introduced lines: 92 introduced LOC across 19 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
}
return ms.chasmTree.ArchetypeID() == chasm.WorkflowArchetypeID
}
func (ms *MutableStateImpl) HSM() *hsm.Node {
// isStateDirty is used upon closing transaction to determine if application data has been updated, and
// mutable state should move to a new versioned transition.
// TODO: we need to track more workflow state changes
// e.g. changes to executionInfo.CancelRequested
// They are mostly covered by history builder check today.
return ms.hBuilder.IsDirty() ||
len(ms.activityInfosUserDataUpdated) > 0 ||
len(ms.deleteActivityInfos) > 0 ||
len(ms.timerInfosUserDataUpdated) > 0 ||
len(ms.deleteTimerInfos) > 0 ||
len(ms.updateChildExecutionInfos) > 0 ||
len(ms.deleteChildExecutionInfos) > 0 ||
len(ms.updateRequestCancelInfos) > 0 ||
len(ms.deleteRequestCancelInfos) > 0 ||
len(ms.updateSignalInfos) > 0 ||
len(ms.deleteSignalInfos) > 0 ||
len(ms.updateSignalRequestedIDs) > 0 ||
len(ms.deleteSignalRequestedIDs) > 0 ||
len(ms.updateInfoUpdated) > 0 ||
ms.visibilityUpdated ||
ms.executionStateUpdated ||
ms.workflowTaskUpdated ||
(ms.stateMachineNode != nil && ms.stateMachineNode.Dirty()) ||
ms.chasmTree.IsStateDirty() ||
ms.isResetStateUpdated ||
ms.timeSkippingInfoUpdated
}
func (ms *MutableStateImpl) IsTransitionHistoryEnabled() bool {
}
transactionPolicy,
); err != nil {
return closeTransactionResult{}, err
}
// and need to reconsider the sequence of time skipping close trx handling in this function
// when supporting chasm.
regenTimerTasksForWorkflowTimeSkipping := ms.closeTransactionHandleWorkflowTimeSkipping(ctx, transactionPolicy)
mutable_state_impl.go
// Save if the state is dirty before closeTransactionPrepareEvents since it flushes the buffer
// events, and therefore change the dirty state.
isStateDirty := ms.isStateDirty()
// closeTransactionPrepareEvents must be called after closeTransactionHandleWorkflowTask because
// the latter might fail the workflow task and buffered events must be flushed afterwards.
// We need to save the value of ms.isStateDirty() before calling closeTransactionPrepareEvents
// because flushing the buffered events might change the dirty state.
workflowEventsSeq, eventBatches, bufferEvents, clearBuffer, err := ms.closeTransactionPrepareEvents(transactionPolicy)
if err != nil {
return closeTransactionResult{}, err
}
func (ms *MutableStateImpl) closeTransactionHandleWorkflowTask(
transactionPolicy historyi.TransactionPolicy,
if err := ms.closeTransactionHandleBufferedEventsLimit(
transactionPolicy,
); err != nil {
return err
}
transactionPolicy,
); err != nil {
return err
}
return ms.closeTransactionHandleSpeculativeWorkflowTask(transactionPolicy)
mutable_state_impl.go
}
func (ms *MutableStateImpl) closeTransactionHandleWorkflowTaskScheduling(
transactionPolicy historyi.TransactionPolicy,
if transactionPolicy == historyi.TransactionPolicyPassive ||
!ms.IsWorkflowExecutionRunning() {
return nil
}
func (ms *MutableStateImpl) closeTransactionHandleSpeculativeWorkflowTask(
transactionPolicy historyi.TransactionPolicy,
if transactionPolicy == historyi.TransactionPolicyPassive ||
!ms.IsWorkflowExecutionRunning() {
return nil
}
func (ms *MutableStateImpl) closeTransactionPrepareEvents(
transactionPolicy historyi.TransactionPolicy,
) ([]*persistence.WorkflowEvents, [][]*historypb.HistoryEvent, []*historypb.HistoryEvent, bool, error) {
mutable_state_impl.go
currentBranchToken, err := ms.GetCurrentBranchToken()
if err != nil {
return nil, nil, nil, false, err
}
historyMutation, err := ms.hBuilder.Finish(!ms.HasStartedWorkflowTask())
mutable_state_impl.go
if err != nil {
return nil, nil, nil, false, err
}
// TODO @wxing1292 need more refactoring to make the logic clean
newBufferBatch := historyMutation.DBBufferBatch
clearBuffer := historyMutation.DBClearBuffer
newEventsBatches := historyMutation.DBEventsBatches
ms.updatePendingEventIDs(historyMutation.ScheduledIDToStartedID, historyMutation.RequestIDToEventID)
workflowEventsSeq := make([]*persistence.WorkflowEvents, len(newEventsBatches))
historyNodeTxnIDs, err := ms.shard.GenerateTaskIDs(len(newEventsBatches))
if err != nil {
return nil, nil, nil, false, err
}
workflowEventsSeq[index] = &persistence.WorkflowEvents{
NamespaceID: ms.executionInfo.NamespaceId,
}
transactionPolicy,
workflowEventsSeq,
); err != nil {
return nil, nil, nil, false, err
}
transactionPolicy historyi.TransactionPolicy,
workflowEventSeq []*persistence.WorkflowEvents,
if transactionPolicy == historyi.TransactionPolicyPassive ||
len(workflowEventSeq) == 0 {
return nil
}
func (ms *MutableStateImpl) closeTransactionHandleBufferedEventsLimit(
transactionPolicy historyi.TransactionPolicy,
if transactionPolicy == historyi.TransactionPolicyPassive ||
!ms.IsWorkflowExecutionRunning() {
return nil
}
}
s.wLock()
defer s.wUnlock()
result := []int64{}
for range number {
id, err := s.generateTaskIDLocked()
if err != nil {
ctx context.Context,
transactionPolicy historyi.TransactionPolicy,
if !ms.IsWorkflow() {
return false
}