pri_task_reader.go ×2

Frontier kind: Code frontier

unlabeled · c_ab1dc2f3d532

85 tests · 3537 LOC · 150 files · introduces 0 tests · 22 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges22 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
574 ranges3537 lines · 150 files · Browse complete extent
All tests (intent)
85 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.

3 files ranked by introduced lines: 22 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/pri_task_reader.go 12 introduced LOC · 2 ranges

Open complete file

367 }
368
369 > func (tr *priTaskReader) signalNewTasks(resp subqueueCreateTasksResponse) { pri_task_reader.go
370 > tr.lock.Lock()
371 >
372 > // We have to be very careful not to increment the read level past an ID that will somehow
373 > // end up in the database, otherwise we might lose a task. We do this by verifying that our
374 > // read level was equal to the previous max read level (i.e. we were at the end of the
375 > // queue), and then we set it to the max read level as of CreateTasks.
376 > // We also check that there's room in memory.
377 > canAddDirect := tr.readLevel == resp.maxReadLevelBefore &&
378 > (tr.loadedTasks+len(resp.tasks)) <= tr.backlogMgr.config.GetTasksBatchSize() &&
379 > !slices.ContainsFunc(resp.tasks, func(t *persistencespb.AllocatedTaskInfo) bool {
380 // Because we checked readLevel, we know that getTasksPump can't have beat us to
381 // adding these tasks to outstandingTasks. So they should definitely not be there.
385 })
386
387 > if !canAddDirect { pri_task_reader.go
388 tr.lock.Unlock()
389 tr.SignalTaskLoading()
go.temporal.io/server/service/matching/pri_backlog_manager.go 8 introduced LOC · 1 range

Open complete file

254 }
255
256 > func (c *priBacklogManagerImpl) signalReaders(resp createTasksResponse) { pri_backlog_manager.go
257 > c.subqueueLock.Lock()
258 > subqueues := slices.Clone(c.subqueues)
259 > c.subqueueLock.Unlock()
260 >
261 > for subqueue, subqueueResp := range resp.bySubqueue {
262 > subqueues[subqueue].signalNewTasks(subqueueResp)
263 > }
264 }
265
go.temporal.io/server/service/matching/pri_task_writer.go 2 introduced LOC · 1 range

Open complete file

134 }
135
136 > w.backlogMgr.signalReaders(resp) pri_task_writer.go
137 > return nil
138 }
139