return nil
}
switch request := request.(type) {
case contextRequestAcquire:
return nil // nothing to do, already acquiring
Frontier kind: Code frontier
unlabeled · c_fae7930d5f35
38 tests · 3242 LOC · 145 files · introduces 0 tests · 35 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: 35 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
return nil
}
switch request := request.(type) {
case contextRequestAcquire:
return nil // nothing to do, already acquiring
}
// Only have to do this once, we can just re-acquire the rangeid lock after that
s.rLock()
if s.shardInfo != nil {
s.rUnlock()
return nil
}
// This is called in two contexts: initially acquiring the rangeid lock, and trying to
// re-acquire it after a persistence error. In both cases, we retry the acquire operation
// (renewRangeLocked) for 5 minutes. Each individual attempt uses shardIOTimeout (by default, 5s) as
// the timeout. This lets us handle a few minutes of persistence unavailability without
// dropping and reloading the whole shard context, which is relatively expensive (includes
// caches that would have to be refilled, etc.).
//
// We stop retrying on any of:
// 1. We succeed in acquiring the rangeid lock.
// 2. We get ShardOwnershipLostError or lifecycleCtx ended.
// 3. The state changes to Stopping or Stopped.
//
// If the shard controller sees that service resolver has assigned ownership to someone
// else, it will call FinishStop, which will trigger case 3 above, and also cancel
// lifecycleCtx. The persistence operations called here use lifecycleCtx as their context,
// so if we were blocked in any of them, they should return immediately with a context
// canceled error.
policy := s.acquireShardRetryPolicy
if policy == nil {
policy = backoff.NewExponentialRetryPolicy(1 * time.Second).WithExpirationInterval(5 * time.Minute)
}
// Remember this value across attempts
op := func() error {
if !s.IsValid() {
return s.newShardClosedErrorWithShardID()
}
// Initial load of shard metadata
if err != nil {
return err
}
// keep retrying except ShardOwnershipLostError or lifecycle context ended
defer func() {
s.contextTaggedLogger.Error(
return true
}
if err != nil {
// We got an non-retryable error, e.g. ShardOwnershipLostError
s.contextTaggedLogger.Error("Couldn't acquire shard", tag.Error(err))