matcher.go ×2

Frontier kind: Code frontier

unlabeled · c_b54595a07a63

3 tests · 3300 LOC · 147 files · introduces 0 tests · 25 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
2 ranges25 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
539 ranges3300 lines · 147 files · Browse complete extent
All tests (intent)
3 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: 25 introduced LOC across 2 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/matcher.go 25 introduced LOC · 2 ranges

Open complete file

306 var reconsiderFwdTimerC <-chan time.Time
307 if fwdTokenC != nil && !tm.isBacklogNegligible() {
308 > // If there is a non-negligible backlog, we stop forwarding to make sure matcher.go
309 > // root and leaf partitions are treated equally and can process their
310 > // backlog at the same rate. Stopping task forwarding, prevent poll
311 > // forwarding as well (in presence of a backlog). This ensures all partitions
312 > // receive polls and tasks at the same rate.
313 >
314 > // Exception: we allow forward if this partition has not got any polls
315 > // recently. This is helpful when there are very few pollers and they
316 > // and they are all stuck in the wrong (root) partition. (Note that since
317 > // frontend balanced the number of pending pollers per partition this only
318 > // becomes an issue when the pollers are fewer than the partitions)
319 > lp := tm.timeSinceLastPoll()
320 > maxWaitForLocalPoller := tm.config.MaxWaitForPollerBeforeFwd()
321 > if lp < maxWaitForLocalPoller {
322 > fwdTokenC = nil
323 > reconsiderFwdTimer = time.NewTimer(maxWaitForLocalPoller - lp)
324 > reconsiderFwdTimerC = reconsiderFwdTimer.C
325 > }
326 }
327
356 continue forLoop
357 }
358 > cancel() matcher.go
359 > // at this point, we forwarded the task to a parent partition which
360 > // in turn dispatched the task to a poller, because there was no error.
361 > // Make sure we delete the task from the database.
362 > task.finish(taskFinishResult{consumedToken: true})
363 > tm.emitDispatchLatency(task, true)
364 > return nil
365 case <-ctx.Done():
366 return ctx.Err()