// start should only be called by the controller.
_ = s.transition(contextRequestAcquire{})
}
func (s *ContextImpl) UnloadForOwnershipLost() {
Frontier kind: Code frontier
unlabeled · c_ca0029bfee48
29 tests · 3536 LOC · 152 files · introduces 0 tests · 130 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/TestAPIToPriorityMappingEvery 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: 130 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
// start should only be called by the controller.
_ = s.transition(contextRequestAcquire{})
}
func (s *ContextImpl) UnloadForOwnershipLost() {
switch s.state {
switch request := request.(type) {
case contextRequestAcquire:
setStateAcquiring()
return nil
case contextRequestStop:
setStateStopping(request)
return nil
}
// We don't have any shardInfo yet, load it (outside of context rwlock)
ctx, cancel := s.newIOContext()
defer cancel()
resp, err := s.persistenceShardManager.GetOrCreateShard(ctx, &persistence.GetOrCreateShardRequest{
ShardID: s.shardID,
LifecycleContext: s.lifecycleCtx,
})
if err != nil {
s.contextTaggedLogger.Error("Failed to load shard", tag.Error(err))
return err
endpointRegistry chasm.EndpointRegistry,
handoverTrackerFactory HandoverTrackerFactory,
hostIdentity := hostInfoProvider.HostInfo().Identity()
sequenceID := atomic.AddInt64(&shardContextSequenceID, 1)
lifecycleCtx, lifecycleCancel := context.WithCancel(context.Background())
ioConcurrency := historyConfig.ShardIOConcurrency()
if ioConcurrency != 1 && persistenceConfig.DataStores[persistenceConfig.DefaultStore].Cassandra != nil {
throttledLogger.Warn(
fmt.Sprintf("Cassandra persistence implementation only supports %v == 1", dynamicconfig.ShardIOConcurrency),
}
taggedLogger := log.With(logger, tag.ShardID(shardID), tag.Address(hostIdentity))
context_impl.go
shardContext := &ContextImpl{
state: contextStateInitialized,
shardID: shardID,
owner: fmt.Sprintf("%s-%v-%v", hostIdentity, sequenceID, uuid.NewString()),
stringRepr: fmt.Sprintf("Shard(%d)", shardID),
executionManager: persistenceExecutionManager,
metricsHandler: metricsHandler,
eventLogger: eventLogger,
closeCallback: closeCallback,
config: historyConfig,
finalizer: finalizer.New(taggedLogger, metricsHandler),
contextTaggedLogger: taggedLogger,
throttledLogger: log.With(throttledLogger, tag.ShardID(shardID), tag.Address(hostIdentity)),
engineFactory: factory,
persistenceShardManager: persistenceShardManager,
clientBean: clientBean,
historyClient: historyClient,
payloadSerializer: payloadSerializer,
timeSource: timeSource,
namespaceRegistry: namespaceRegistry,
saProvider: saProvider,
saMapperProvider: saMapperProvider,
clusterMetadata: clusterMetadata,
archivalMetadata: archivalMetadata,
hostInfoProvider: hostInfoProvider,
taskCategoryRegistry: taskCategoryRegistry,
lifecycleCtx: lifecycleCtx,
lifecycleCancel: lifecycleCancel,
engineFuture: future.NewFuture[historyi.Engine](),
queueMetricEmitter: sync.Once{},
ioSemaphore: locks.NewPrioritySemaphore(ioConcurrency),
stateMachineRegistry: stateMachineRegistry,
chasmRegistry: chasmRegistry,
chasmWorkflowRegistry: chasmWorkflowRegistry,
endpointRegistry: endpointRegistry,
businessIDRateLimiters: cache.New(
historyConfig.BusinessIDReuseLimiterCacheSize(),
&cache.Options{TTL: historyConfig.BusinessIDReuseLimiterCacheTTL()},
),
}
shardContext.taskKeyManager = newTaskKeyManager(
shardContext.taskCategoryRegistry,
timeSource,
historyConfig,
shardContext.GetLogger(),
func() error {
return shardContext.renewRangeLocked(false)
},
)
ClusterMetadata: clusterMetadata,
GetMaxReplicationTaskID: shardContext.getMaxReplicationTaskID,
ErrorByStateFn: shardContext.errorByState,
NotifyReplicationFn: shardContext.notifyReplicationQueueProcessor,
NamespaceRegistry: namespaceRegistry,
Logger: taggedLogger,
})
if shardContext.GetConfig().EnableHostLevelEventsCache() {
shardContext.eventsCache = eventsCache
shardContext.eventsCache = events.NewShardLevelEventsCache(
shardContext.executionManager,
shardContext.config,
shardContext.metricsHandler,
shardContext.contextTaggedLogger,
false,
)
}
shardContext.initLastUpdatesTime()
return shardContext, nil
}
shardID int32,
closeCallback CloseCallback,
shard, err := newContext(
shardID,
c.EngineFactory,
c.Config,
c.PersistenceConfig,
closeCallback,
c.Logger,
c.ThrottledLogger,
c.PersistenceExecutionManager,
c.PersistenceShardManager,
c.ClientBean,
c.HistoryClient,
c.MetricsHandler,
c.EventLogger,
c.PayloadSerializer,
c.TimeSource,
c.NamespaceRegistry,
c.SaProvider,
c.SaMapperProvider,
c.ClusterMetadata,
c.ArchivalMetadata,
c.HostInfoProvider,
c.TaskCategoryRegistry,
c.EventsCache,
c.StateMachineRegistry,
c.ChasmRegistry,
c.ChasmWorkflowRegistry,
c.EndpointRegistry,
c.HandoverTrackerFactory,
)
if err != nil {
return nil, err
}
return shard, nil
}
logger log.Logger,
disabled bool,
return newEventsCache(executionManager, handler, logger, config.EventsShardLevelCacheMaxSizeBytes(), config.EventsCacheTTL(), disabled)
}
func newEventsCache(