matching_engine.go ×5

Frontier kind: Code frontier

unlabeled · c_9cd77aacd507

166 tests · 2916 LOC · 143 files · introduces 0 tests · 18 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges18 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
446 ranges2916 lines · 143 files · Browse complete extent
All tests (intent)
166 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: 18 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/matching_engine.go 18 introduced LOC · 5 ranges

Open complete file

3009 partition tqid.Partition,
3010 pollMetadata *pollMetadata,
3011 > ) (*internalTask, bool, error) { matching_engine.go
3012 > pm, _, err := e.getTaskQueuePartitionManager(ctx, partition, true, loadCausePoll)
3013 > if err != nil {
3014 return nil, false, err
3015 }
3016
3017 > pollMetadata.localPollStartTime = e.timeSource.Now() matching_engine.go
3018 >
3019 > // We need to set a shorter timeout than the original ctx; otherwise, by the time ctx deadline is
3020 > // reached, instead of emptyTask, context timeout error is returned to the frontend by the rpc stack,
3021 > // which counts against our SLO. By shortening the timeout by a very small amount, the emptyTask can be
3022 > // returned to the handler before a context timeout error is generated.
3023 > workerInstanceKey := pollMetadata.workerInstanceKey
3024 > if workerInstanceKey != "" && e.shutdownWorkers.Get(workerInstanceKey) != nil {
3025 e.logger.Info("Rejecting poll from recently-shutdown worker",
3026 tag.WorkflowNamespaceID(partition.NamespaceId()),
3035 // times across pollers and prevent thundering herd reconnects. Jitter is capped so the
3036 // interval never falls below forwardedPollMinInterval.
3037 > longPollInterval := pm.LongPollExpirationInterval() matching_engine.go
3038 > if pollMetadata.forwardedFrom == "" {
3039 jitterMax := time.Duration(float64(longPollInterval) * forwardedPollJitterRatio)
3040 if longPollInterval-jitterMax < forwardedPollMinInterval {
3045 }
3046 }
3047 > ctx, cancel := contextutil.WithDeadlineBuffer(ctx, longPollInterval, returnEmptyTaskTimeBudget) matching_engine.go
3048 > defer cancel()
3049 >
3050 > if pollerID, ok := ctx.Value(pollerIDKey).(string); ok && pollerID != "" {
3051 e.outstandingPollers.Set(pollerID, cancel)
3052
3065 }()
3066 }
3067 > return pm.PollTask(ctx, pollMetadata) matching_engine.go
3068 }
3069