registry.go ×7

Frontier kind: Code frontier

unlabeled · c_878bb0c72d62

20 tests · 2379 LOC · 94 files · introduces 0 tests · 21 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges21 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
380 ranges2379 lines · 94 files · Browse complete extent
All tests (intent)
20 testsBrowse complete intent

Neighbourhood graph

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.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 21 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/namespace/nsregistry/registry.go 21 introduced LOC · 7 ranges

Open complete file

224 r.refresher, watchStarted = r.runWatchLoop(ctx)
225 if watchStarted {
226 > // Watch started successfully registry.go
227 > return
228 > }
229
230 if err := r.refresher.Err(); !errors.Is(err, persistence.ErrWatchNotSupported) {
405 // watchLoop processes namespace watch events and handles restarts on failure.
406 // It returns when the context is cancelled or the watch channel is closed.
407 > func (r *registry) watchLoop(ctx context.Context, watchCh <-chan *persistence.NamespaceWatchEvent) { registry.go
408 > r.logger.Info("Starting namespace registry loop")
409 > for {
410 > select {
411 > case <-ctx.Done():
412 > return
413 case event, ok := <-watchCh:
414 var err error
457 for {
458 select {
459 > case <-ctx.Done(): registry.go
460 > return nil
461 default:
462 }
467 }
468
469 > watchStartedOnce.Shutdown() registry.go
470 > r.watchLoop(result.watchCtx, result.eventCh)
471 > result.watchCancel()
472 }
473 },
477 // or because watch is not supported). Return true only if watch started successfully.
478 select {
479 > case <-watchStartedOnce.Channel(): registry.go
480 > return handle, true
481 case <-handle.Done():
482 return handle, false
511 // A full refresh must be done *after* (not before) the watch is established to ensure no updates are missed. If the
512 // refresh were done before establishing the watch, updates that occur between the two could be missed.
513 > r.logger.Info("Namespace watch started") registry.go
514 > if err = r.refreshNamespaces(ctx); err != nil {
515 r.logger.Error("Error refreshing namespaces after watch start", tag.Error(err))
516 return
517 }
518 > r.logger.Info("Initial refresh completed") registry.go
519 >
520 > return
521 },
522 watchStartRetryPolicy(initialWatch),