service_resolver.go ×4

Frontier kind: Code frontier

unlabeled · c_97c043d49c86

10 tests · 21695 LOC · 595 files · introduces 0 tests · 49 LOC · 8 files

Introduces — evidence that enters the hierarchy at this concept

Code
16 ranges49 lines · 8 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4266 ranges21695 lines · 595 files · Browse complete extent
All tests (intent)
10 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.

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

go.temporal.io/server/temporal/server_impl.go 12 introduced LOC · 3 ranges

Open complete file

107 }
108
109 > func (s *ServerImpl) Stop(ctx context.Context) error { server_impl.go
110 > close(s.stoppedCh)
111 >
112 > svcs := slices.Clone(s.servicesMetadata)
113 > slices.SortFunc(svcs, func(a, b *ServicesMetadata) int {
114 > return -cmp.Compare(initOrder[a.serviceName], initOrder[b.serviceName]) // note negative
115 > })
116 > for _, svc := range svcs {
117 > svc.Stop(ctx)
118 > }
119
120 > if s.so.metricHandler != nil { server_impl.go
121 s.so.metricHandler.Stop(s.logger)
122 }
123 > return nil server_impl.go
124 }
125
go.temporal.io/server/common/dynamicconfig/collection.go 9 introduced LOC · 3 ranges

Open complete file

165 c.pollOnce()
166 }
167 > return ctx.Err() collection.go
168 }
169
170 > func (c *Collection) pollOnce() { collection.go
171 > c.subscriptionLock.Lock()
172 > defer c.subscriptionLock.Unlock()
173 >
174 > for key, subs := range c.subscriptions {
175 > setting := queryRegistry(key)
176 > if setting == nil {
177 continue
178 }
179 > for _, sub := range subs { collection.go
180 cvs := c.client.GetValue(key)
181 setting.dispatchUpdate(c, sub, cvs)
go.temporal.io/server/common/membership/ringpop/service_resolver.go 8 introduced LOC · 4 ranges

Open complete file

152 func (r *serviceResolver) RequestRefresh() {
153 select {
154 > case r.refreshChan <- struct{}{}: service_resolver.go
155 default:
156 }
162 addr, found := ring.Lookup(key)
163 if !found {
164 > r.RequestRefresh() service_resolver.go
165 > return nil, membership.ErrInsufficientHosts
166 > }
167 return hosts[addr], nil
168 }
275
276 if mode == refreshModeLazy && r.lastRefreshTime.After(time.Now().UTC().Add(-minRefreshInternal)) {
277 > return nil // refreshed too recently service_resolver.go
278 > }
279
280 event, err = r.refreshLocked()
428 case <-r.shutdownCh:
429 return
430 > case <-r.refreshChan: service_resolver.go
431 > if err := r.refresh(refreshModeLazy); err != nil {
432 r.logger.Error("error refreshing ring by request", tag.Error(err))
433 }
go.temporal.io/server/temporal/fx.go 8 introduced LOC · 2 ranges

Open complete file

350
351 // Stop stops the server.
352 > func (s *ServerFx) Stop() error { fx.go
353 > return s.app.Stop(context.Background())
354 > }
355
356 > func (svc *ServicesMetadata) Stop(ctx context.Context) { fx.go
357 > stopCtx, cancelFunc := context.WithTimeout(ctx, serviceStopTimeout)
358 > defer cancelFunc()
359 > err := svc.app.Stop(stopCtx)
360 > if err != nil {
361 svc.logger.Error("Failed to stop service", tag.Service(svc.serviceName), tag.Error(err))
362 }
go.temporal.io/server/common/membership/ringpop/factory.go 5 introduced LOC · 1 range

Open complete file

240
241 // closeTChannel allows fx Stop hook to close channel
242 > func (factory *factory) closeTChannel() { factory.go
243 > if factory.channel != nil {
244 > factory.getTChannel().Close()
245 > factory.channel = nil
246 > }
247 }
248
go.temporal.io/server/common/membership/ringpop/monitor.go 3 introduced LOC · 1 range

Open complete file

397 }
398
399 > func (rpo *monitor) EvictSelf() error { monitor.go
400 > return rpo.rp.SelfEvict()
401 > }
402
403 func (rpo *monitor) EvictSelfAt(asOf time.Time) (time.Duration, error) {
go.temporal.io/server/client/history/connections.go 2 introduced LOC · 1 range

Open complete file

110 case event := <-ch:
111 for _, h := range event.HostsRemoved {
112 > evictAt[rpcAddress(h.GetAddress())] = time.Now().Add(c.connectionCloseDelay()) connections.go
113 > }
114 for _, h := range event.HostsAdded {
115 delete(evictAt, rpcAddress(h.GetAddress()))
go.temporal.io/server/client/matching/client.go 2 introduced LOC · 1 range

Open complete file

116 case event := <-ch:
117 for _, h := range event.HostsRemoved {
118 > evictAt[h.GetAddress()] = time.Now().Add(c.connectionCloseDelay()) client.go
119 > }
120 for _, h := range event.HostsAdded {
121 delete(evictAt, h.GetAddress())