task_processor.go ×7

Frontier kind: Code frontier

unlabeled · c_f513302dc7cb

3 tests · 4351 LOC · 194 files · introduces 0 tests · 24 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges24 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
655 ranges4351 lines · 194 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: 24 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/replication/task_processor.go 24 introduced LOC · 7 ranges

Open complete file

313 ctx context.Context,
314 replicationTask *replicationspb.ReplicationTask,
315 > ) (retErr error) { task_processor.go
316 > _ = p.rateLimiter.Wait(ctx)
317 >
318 > operationTagValue := p.getOperationTagValue(replicationTask)
319 >
320 > operation := func() error {
321 > var err error
322 > // Tests use this hook to pause replication tasks before they are applied.
323 > if hook, ok := testhooks.Get(p.testHooks, testhooks.HistoryReplicationTaskInterceptor, testhooks.GlobalScope); ok {
324 err = hook(replicationTask, func() error {
325 return p.replicationTaskExecutor.Execute(ctx, replicationTask, false)
326 })
327 > } else { task_processor.go
328 > err = p.replicationTaskExecutor.Execute(ctx, replicationTask, false)
329 > }
330 p.emitTaskMetrics(operationTagValue, err)
331 return err
332 }
333
334 > var panicErr error task_processor.go
335 > defer func() {
336 > if panicErr != nil {
337 retErr = panicErr
338 p.emitTaskMetrics(operationTagValue, panicErr)
340 }()
341
342 > defer log.CapturePanic(p.logger, &panicErr) task_processor.go
343 >
344 > return backoff.ThrottleRetry(operation, p.taskRetryPolicy, p.isRetryableError)
345 }
346
540 }
541
542 > func (p *taskProcessorImpl) emitTaskMetrics(operation string, err error) { task_processor.go
543 > metricsScope := p.metricsHandler.WithTags(metrics.OperationTag(operation))
544 > if common.IsContextDeadlineExceededErr(err) || common.IsContextCanceledErr(err) {
545 metrics.ServiceErrContextTimeoutCounter.With(metricsScope).Record(1)
546 return
548
549 // Also update counter to distinguish between type of failures
550 > switch err := err.(type) { task_processor.go
551 case nil:
552 metrics.ReplicationTasksApplied.With(metricsScope).Record(1)
574 func (p *taskProcessorImpl) getOperationTagValue(
575 replicationTask *replicationspb.ReplicationTask,
576 > ) string { task_processor.go
577 > switch replicationTask.GetTaskType() {
578 case enumsspb.REPLICATION_TASK_TYPE_SYNC_SHARD_STATUS_TASK:
579 return metrics.SyncShardTaskScope