c.RLock()
if shard, ok := c.historyShards[shardID]; ok {
c.RUnlock()
return shard, nil
}
// if shard not valid then proceed to create a new one
}
Frontier kind: Code frontier
unlabeled · c_bf5cd7a60383
28 tests · 3180 LOC · 140 files · introduces 0 tests · 32 LOC · 1 file
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.
1 file ranked by introduced lines: 32 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
c.RLock()
if shard, ok := c.historyShards[shardID]; ok {
c.RUnlock()
return shard, nil
}
// if shard not valid then proceed to create a new one
}
}
ownedShardsLock.Lock()
ownedShards = append(ownedShards, shardID)
ownedShardsLock.Unlock()
}
if err != nil {
metrics.GetEngineForShardErrorCounter.With(c.taggedMetricsHandler).Record(1)
c.contextTaggedLogger.Error("Unable to create history shard context", tag.Error(err), tag.OperationFailed, tag.ShardID(shardID))
// Wait up to 1s for the shard to acquire the rangeid lock.
// After 1s we will move on but the shard will continue trying in the background.
defer engineCancel()
_, _ = shard.GetEngine(engineCtx)
}
if readinessCtx != nil {
if len(ownedShards) > 0 {
defer readinessCancel()
if c.checkShardReadiness(readinessCtx, ownedShards) {
c.initialShardsAcquired.SetIfNotReady(struct{}{}, nil)
}
ctx context.Context,
shards []int32,
concurrency := int64(max(c.config.AcquireShardConcurrency(), 1))
sem := semaphore.NewWeighted(concurrency)
var ready atomic.Int32
for _, shardID := range shards {
if sem.Acquire(ctx, 1) != nil {
return false
}
defer sem.Release(1)
// Note that AssertOwnership uses a detached context for the actual persistence
// op so we can't cancel it. If context is canceled, the final Acquire will
// fail and we won't do anything.
if shard, err := c.GetShardByID(shardID); err != nil {
return
return
return
}
}()
}
return false
}