physical_task_queue_manager.go ×3

Frontier kind: Code frontier

unlabeled · c_391833ba3985

346 tests · 3668 LOC · 170 files · introduces 0 tests · 29 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges29 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
623 ranges3668 lines · 170 files · Browse complete extent
All tests (intent)
346 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: 29 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/physical_task_queue_manager.go 20 introduced LOC · 3 ranges

Open complete file

311 // Stop does not unload the queue from its partition. It is intended to be called by the partition manager when
312 // unloading a queues. For stopping and unloading a queue call UnloadFromPartitionManager instead.
313 > func (c *physicalTaskQueueManagerImpl) Stop(unloadCause unloadCause) { physical_task_queue_manager.go
314 > if !atomic.CompareAndSwapInt32(
315 > &c.status,
316 > common.DaemonStatusStarted,
317 > common.DaemonStatusStopped,
318 > ) {
319 return
320 }
321 // this may attempt to write one final ack update, do this before canceling tqCtx
322 > c.backlogMgr.Stop() physical_task_queue_manager.go
323 > if m := c.getDrainBacklogMgr(); m != nil {
324 m.Stop()
325 }
326 > c.matcher.Stop() physical_task_queue_manager.go
327 > c.liveness.Stop()
328 > c.tqCtxCancel()
329 >
330 > // Emitting zero values for backlog gauges to prevent stale values persisting after a partition is unloaded.
331 > // The call is placed here instead of backlogMgr.Stop() since there could be a race condition where a task is
332 > // added to the backlog after we have emitted the zero values inside of the backlogMgr.Stop() call. This happens
333 > // since task reader's and writer's contexts are cancelled after the backlogMgr.Stop() call.
334 > c.backlogMgr.getDB().emitZeroPhysicalBacklogGauges()
335 > c.logger.Info("Stopped physicalTaskQueueManager", tag.LifeCycleStopped, tag.Cause(unloadCause.String()))
336 > c.metricsHandler.Counter(metrics.TaskQueueStoppedCounter.Name()).Record(1)
337 > c.partitionMgr.engine.updatePhysicalTaskQueueGauge(c.partitionMgr.ns, c.partitionMgr.partition, c.queue.version, -1)
338 }
339
go.temporal.io/server/service/matching/db.go 6 introduced LOC · 2 ranges

Open complete file

957 }
958
959 > func (db *taskQueueDB) emitZeroPhysicalBacklogGauges() { db.go
960 > if !db.config.BreakdownMetricsByTaskQueue() || !db.config.BreakdownMetricsByPartition() {
961 return
962 }
963
964 > attributionEnabled := db.config.BacklogMetricsEmitInterval() > 0 db.go
965 >
966 > if attributionEnabled {
967 > if db.queue.IsVersioned() {
968 return
969 }
go.temporal.io/server/service/matching/unloadcause_string_gen.go 3 introduced LOC · 2 ranges

Open complete file

24 var _unloadCause_index = [...]uint8{0, 11, 20, 24, 34, 42, 54, 59, 71, 81}
25
26 > func (i unloadCause) String() string { unloadcause_string_gen.go
27 > if i < 0 || i >= unloadCause(len(_unloadCause_index)-1) {
28 return "unloadCause(" + strconv.FormatInt(int64(i), 10) + ")"
29 }
30 > return _unloadCause_name[_unloadCause_index[i]:_unloadCause_index[i+1]] unloadcause_string_gen.go
31 }