activity.go ×6

Frontier kind: Joint frontier

unlabeled · c_9448ca878fec

1 test · 4968 LOC · 200 files · introduces 1 test · 32 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges32 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
820 ranges4968 lines · 200 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

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

go.temporal.io/server/service/history/workflow/activity.go 27 introduced LOC · 6 ranges

Open complete file

452 resetHeartbeats bool,
453 jitter time.Duration,
454 > ) (*historyservice.UnpauseActivityResponse, error) { activity.go
455 > if err := mutableState.UpdateActivity(ai.ScheduledEventId, func(activityInfo *persistencespb.ActivityInfo, ms historyi.MutableState) error {
456 > unpauseActivityInfo(activityInfo)
457 >
458 > // reset the number of attempts
459 > activityInfo.Attempt = 1
460 >
461 > if needRegenerateRetryTask(activityInfo, scheduleNewRun) {
462 > if err := regenerateActivityRetryTask(activityInfo, scheduleNewRun, jitter, ms, shardContext); err != nil {
463 return err
464 }
465 }
466
467 > if resetHeartbeats { activity.go
468 > activityInfo.LastHeartbeatDetails = nil
469 > activityInfo.LastHeartbeatUpdateTime = nil
470 > }
471 > return nil
472 }); err != nil {
473 return nil, err
474 }
475
476 > return &historyservice.UnpauseActivityResponse{}, nil activity.go
477 }
478
494 }
495
496 > func needRegenerateRetryTask(ai *persistencespb.ActivityInfo, scheduleNewRun bool) bool { activity.go
497 > // if activity is Paused - we don't need to do anything
498 > if ai.Paused {
499 return false
500 }
501
502 > if scheduleNewRun { activity.go
503 // we need to always regenerate the retry task if scheduleNewRun flag is provided
504 // but for a different reasons.
508 }
509
510 > if GetActivityState(ai) == enumspb.PENDING_ACTIVITY_STATE_SCHEDULED { activity.go
511 > // activity is waiting to start, scheduleNewRun flag is NOT provided
512 > // in this case we still need to increase the Stamp
513 > // this is because we reset the number of attempts, and this will prevent old retry from executing
514 > // we also need to start the activity immediately - no reason to wait
515 > // we still need to increase the stamp in case the number of attempts doesn't change
516 > return true
517 > }
518
519 // activity is running, scheduleNewRun flag is NOT provided
go.temporal.io/server/api/persistence/v1/executions.pb.go 5 introduced LOC · 1 range

Open complete file

4601 }
4602
4603 > func (x *ActivityInfo_PauseInfo) GetRuleId() string { executions.pb.go
4604 > if x != nil {
4605 > if x, ok := x.PausedBy.(*ActivityInfo_PauseInfo_RuleId); ok {
4606 > return x.RuleId
4607 > }
4608 }
4609 return ""