controller_impl.go ×4

Frontier kind: Code frontier

unlabeled · c_4d58551ec575

18 tests · 3135 LOC · 139 files · introduces 0 tests · 29 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges29 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
433 ranges3135 lines · 139 files · Browse complete extent
All tests (intent)
18 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.

2 files ranked by introduced lines: 29 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/shard/controller_impl.go 19 introduced LOC · 4 ranges

Open complete file

117 }
118
119 > func (c *ControllerImpl) Stop() { controller_impl.go
120 > if !atomic.CompareAndSwapInt32(
121 > &c.status,
122 > common.DaemonStatusStarted,
123 > common.DaemonStatusStopped,
124 > ) {
125 return
126 }
127
128 > c.initialShardsAcquired.SetIfNotReady(struct{}{}, context.Canceled) controller_impl.go
129 >
130 > c.ownership.stop()
131 >
132 > c.doShutdown()
133 >
134 > c.contextTaggedLogger.Info("", tag.LifeCycleStopped)
135 }
136
534 }
535
536 > func (c *ControllerImpl) doShutdown() { controller_impl.go
537 > c.contextTaggedLogger.Info("", tag.LifeCycleStopping)
538 > c.Lock()
539 > defer c.Unlock()
540 > for _, shard := range c.historyShards {
541 shard.FinishStop()
542 }
543 > c.historyShards = nil controller_impl.go
544 }
545
go.temporal.io/server/service/history/shard/ownership.go 10 introduced LOC · 4 ranges

Open complete file

83 for {
84 select {
85 > case <-ctx.Done(): ownership.go
86 > return
87 case <-acquireTicker.C:
88 o.scheduleAcquire()
111 for {
112 select {
113 > case <-ctx.Done(): ownership.go
114 > return
115 case <-o.acquireCh:
116 controller.acquireShards(ctx)
119 }
120
121 > func (o *ownership) stop() { ownership.go
122 > if err := o.historyServiceResolver.RemoveListener(
123 > shardControllerMembershipUpdateListenerName,
124 > ); err != nil {
125 o.logger.Error("Error removing membership update listener", tag.Error(err), tag.OperationFailed)
126 }
127
128 > o.goros.Cancel() ownership.go
129 > o.goros.Wait()
130 }
131