endpoint_registry.go ×2

Frontier kind: Code frontier

unlabeled · c_93b295577e4f

16 tests · 2103 LOC · 86 files · introduces 0 tests · 32 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
2 ranges32 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
305 ranges2103 lines · 86 files · Browse complete extent
All tests (intent)
16 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: 32 introduced LOC across 2 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/nexus/endpoint_registry.go 32 introduced LOC · 2 ranges

Open complete file

233 err := backoff.ThrottleRetryContext(ctx, r.loadEndpoints, r.config.refreshRetryPolicy, nil)
234 if err == nil {
235 > hasLoadedEndpointData = true endpoint_registry.go
236 > enforceMinWait = false
237 > // Note: do not reload r.dataReady here, use value from argument to ensure that
238 > // each channel is closed no more than once.
239 > close(dataReady.ready)
240 > }
241 > } else {
242 > r.dataLock.Lock()
243 > prevTableVersion := r.tableVersion
244 > r.dataLock.Unlock()
245 >
246 > // Endpoints have previously been loaded, so just keep them up to date with long poll requests to
247 > // matching, without fallback to persistence. Ignoring long poll errors since we will just retry
248 > // on next loop iteration.
249 > _ = backoff.ThrottleRetryContext(ctx, r.refreshEndpoints, r.config.refreshRetryPolicy, nil)
250 >
251 > r.dataLock.Lock()
252 > enforceMinWait = prevTableVersion == r.tableVersion
253 > r.dataLock.Unlock()
254 > }
255 elapsed := time.Since(start)
256
292
293 // refreshEndpoints sends long-poll requests to matching to check for any updates to endpoint data.
294 > func (r *EndpointRegistryImpl) refreshEndpoints(ctx context.Context) error { endpoint_registry.go
295 > r.dataLock.RLock()
296 > currentTableVersion := r.tableVersion
297 > r.dataLock.RUnlock()
298 >
299 > resp, err := r.matchingClient.ListNexusEndpoints(ctx, &matchingservice.ListNexusEndpointsRequest{
300 > NextPageToken: nil,
301 > PageSize: int32(r.config.refreshPageSize()),
302 > LastKnownTableVersion: currentTableVersion,
303 > Wait: true,
304 > })
305 > if err != nil {
306 if ctx.Err() == nil {
307 r.logger.Error("long poll to refresh Nexus endpoints returned error", tag.Error(err))