}
return atomic.LoadInt32(&wm.status) == common.DaemonStatusStarted
}
func (wm *PerNamespaceWorkerManager) Start(
Frontier kind: Code frontier
unlabeled · c_e087dafae0a7
25 tests · 3058 LOC · 154 files · introduces 0 tests · 58 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/service/worker/TestPerNsWorkerManager/TestEnabledgo.temporal.io/server/service/worker/TestPerNsWorkerManager/TestMultiplicitygo.temporal.io/server/service/worker/TestPerNsWorkerManager/TestOptionsgo.temporal.io/server/service/worker/TestPerNsWorkerManager/TestTwoNamespacesTwoComponentsgo.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/rpc/interceptor/TestMethodToPatternMappinggo.temporal.io/server/common/rpc/interceptor/TestNamespaceSuite/TestFrontendAPIMetricsgo.temporal.io/server/common/rpc/interceptor/TestNamespaceSuite/TestHistoryAPIMetricsgo.temporal.io/server/common/rpc/interceptor/TestNamespaceSuite/TestMatchingAPIMetricsgo.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: 58 introduced LOC across 16 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
}
return atomic.LoadInt32(&wm.status) == common.DaemonStatusStarted
}
func (wm *PerNamespaceWorkerManager) Start(
}
func (wm *PerNamespaceWorkerManager) namespaceCallback(ns *namespace.Namespace, nsDeleted bool) {
pernamespaceworker.go
go wm.getWorkerByNamespace(ns).update(ns, nsDeleted, nil, nil)
}
func (wm *PerNamespaceWorkerManager) refreshAll() {
}
func (wm *PerNamespaceWorkerManager) getWorkerByNamespace(ns *namespace.Namespace) *perNamespaceWorker {
pernamespaceworker.go
wm.lock.Lock()
defer wm.lock.Unlock()
if worker, ok := wm.workers[ns.ID()]; ok {
return worker
}
wm: wm,
logger: log.With(wm.logger, tag.WorkflowNamespace(ns.Name().String())),
retrier: backoff.NewRetrier(backoff.NewExponentialRetryPolicy(wm.initialRetry), clock.NewRealTimeSource()),
}
count, c1 := wm.config.PerNamespaceWorkerCount(ns.Name().String(), worker.setWorkerCount)
opts, c2 := wm.config.PerNamespaceWorkerOptions(ns.Name().String(), worker.setWorkerOptions)
worker.ns = ns
worker.count = count
worker.opts = opts
worker.cancel = func() { c1(); c2() }
return worker
}
// called on namespace state change callback, membership change, and dynamic config change
func (w *perNamespaceWorker) update(ns *namespace.Namespace, nsDeleted bool, newCount *int, newOpts *sdkworker.Options) {
pernamespaceworker.go
w.lock.Lock()
if ns != nil {
w.ns = ns
// The name inside of *ns, which was used to initialize the logger, can change, but
// don't update w.logger here, otherwise we'd have to hold w.lock just to log.
}
if newCount != nil {
w.count = *newCount
}
w.opts = *newOpts
}
isRetrying := w.retryTimer != nil
w.lock.Unlock()
if nsDeleted {
w.stopWorkerAndResetTimer()
// if namespace is fully deleted from db, we can remove from our map also
}
w.refresh(refreshArgs)
}
}
// handleError should be called on errors from worker creation or run. it will attempt to
// refresh the worker again at a later time.
if err == nil {
return
}
// Returning an error from here means that we should retry creating/starting the worker.
// Returning noWorkerNeeded means any existing worker should be stopped.
defer func() {
w.handleError(retErr)
}()
// note w.lock is not locked until we're about to start/stop a worker
args.ns.State() == enumspb.NAMESPACE_STATE_DELETED ||
//nolint:forbidigo // per-namespace worker lifecycle, no workflow context
!args.ns.ActiveInCluster(w.wm.thisClusterName) {
return errNoWorkerNeeded
}
for _, cleanup := range w.cleanup {
cleanup()
}
if w.worker != nil {
w.worker.Stop()
w.worker = nil
}
w.client.Close()
w.client = nil
}
}