task_queue_partition_manager.go ×6

Frontier kind: Code frontier

unlabeled · c_f9e6af74711b

3 tests · 6908 LOC · 201 files · introduces 0 tests · 24 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges24 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1485 ranges6908 lines · 201 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.

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

go.temporal.io/server/service/matching/task_queue_partition_manager.go 22 introduced LOC · 6 ranges

Open complete file

1520 return ctx.Err()
1521
1522 > case <-time.After(backoff.Jitter(interval, 0.05)): task_queue_partition_manager.go
1523 > prevBacklogPriority = pm.updateEphemeralDataIteration(prevBacklogPriority)
1524 }
1525 }
1526 }
1527
1528 > func (pm *taskQueuePartitionManagerImpl) updateEphemeralDataIteration(prevBacklogPriority map[PhysicalTaskQueueVersion]int64) map[PhysicalTaskQueueVersion]int64 { task_queue_partition_manager.go
1529 > negligibleAge := pm.config.BacklogNegligibleAge()
1530 > backlogPriority := make(map[PhysicalTaskQueueVersion]int64)
1531 >
1532 > setLevels := func(vk PhysicalTaskQueueVersion, vq physicalTaskQueueManager) {
1533 > var levels int64
1534 > for key, stats := range vq.GetStatsByPriority(false) {
1535 > if key < 64 && stats.ApproximateBacklogAge.AsDuration() > negligibleAge {
1536 levels = levels | 1<<key
1537 }
1538 }
1539 > if levels != 0 { task_queue_partition_manager.go
1540 backlogPriority[vk] = levels
1541 }
1542 }
1543
1544 > dbq := pm.defaultQueue() task_queue_partition_manager.go
1545 > if dbq == nil {
1546 return prevBacklogPriority // shouldn't happen, we only start after initialization
1547 }
1548 > setLevels(PhysicalTaskQueueVersion{}, dbq) task_queue_partition_manager.go
1549 >
1550 > pm.versionedQueuesLock.RLock()
1551 > for vk, vq := range pm.versionedQueues {
1552 if vk.buildId == "" || vk.deploymentSeriesName == "" {
1553 continue // v3 only
1555 setLevels(vk, vq)
1556 }
1557 > pm.versionedQueuesLock.RUnlock() task_queue_partition_manager.go
1558 >
1559 > if maps.Equal(backlogPriority, prevBacklogPriority) {
1560 > return prevBacklogPriority
1561 > }
1562
1563 pm.userDataManager.LocalBacklogPriorityChanged(backlogPriority)
go.temporal.io/server/service/matching/pri_matcher.go 2 introduced LOC · 1 range

Open complete file

418 case syncMatchSuccess:
419 return finish()
420 > case syncMatchBacklogPresent: pri_matcher.go
421 > return outcome, nil
422 default:
423 // We only block if we are the root and the task is forwarded from a backlog.