api.go ×4

Frontier kind: Code frontier

unlabeled · c_efdde0a64034

2 tests · 4466 LOC · 196 files · introduces 0 tests · 44 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges44 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
728 ranges4466 lines · 196 files · Browse complete extent
All tests (intent)
2 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: 44 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/api/updateactivityoptions/api.go 24 introduced LOC · 4 ranges

Open complete file

166
167 // fill the response
168 > response := &historyservice.UpdateActivityOptionsResponse{ api.go
169 > ActivityOptions: adjustedOptions,
170 > }
171 > return response, nil
172 }
173
215 }
216
217 > return updateActivityOptions(mutableState, ai, adjustedOptions) api.go
218 }
219
241 }
242
243 > ao.ScheduleToCloseTimeout = attributes.ScheduleToCloseTimeout api.go
244 > ao.ScheduleToStartTimeout = attributes.ScheduleToStartTimeout
245 > ao.StartToCloseTimeout = attributes.StartToCloseTimeout
246 > ao.HeartbeatTimeout = attributes.HeartbeatTimeout
247 >
248 > return ao, nil
249 }
250
299
300 if workflow.GetActivityState(ai) == enumspb.PENDING_ACTIVITY_STATE_SCHEDULED {
301 > // in this case we always want to generate a new retry task api.go
302 >
303 > // two options - activity can be in backoff, or scheduled (waiting to be started)
304 > // if activity in backoff
305 > // in this case there is already old retry task
306 > // it will be ignored because of stamp mismatch
307 > // if activity is scheduled and waiting to be started
308 > // eventually matching service will call history service (recordActivityTaskStarted)
309 > // history service will return error based on stamp. Task will be dropped
310 >
311 > nextScheduledTime := workflow.GetNextScheduledTime(ai)
312 > err = ms.RegenerateActivityRetryTask(ai, nextScheduledTime)
313 > if err != nil {
314 return nil, err
315 }
go.temporal.io/server/service/history/interfaces/mutable_state_mock.go 10 introduced LOC · 2 ranges

Open complete file

3432
3433 // RegenerateActivityRetryTask mocks base method.
3434 > func (m *MockMutableState) RegenerateActivityRetryTask(ai *persistence.ActivityInfo, newScheduledTime time.Time) error { mutable_state_mock.go
3435 > m.ctrl.T.Helper()
3436 > ret := m.ctrl.Call(m, "RegenerateActivityRetryTask", ai, newScheduledTime)
3437 > ret0, _ := ret[0].(error)
3438 > return ret0
3439 > }
3440
3441 // RegenerateActivityRetryTask indicates an expected call of RegenerateActivityRetryTask.
3442 > func (mr *MockMutableStateMockRecorder) RegenerateActivityRetryTask(ai, newScheduledTime any) *gomock.Call { mutable_state_mock.go
3443 > mr.mock.ctrl.T.Helper()
3444 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegenerateActivityRetryTask", reflect.TypeOf((*MockMutableState)(nil).RegenerateActivityRetryTask), ai, newScheduledTime)
3445 > }
3446
3447 // RejectWorkflowExecutionUpdate mocks base method.
go.temporal.io/server/service/history/workflow/activity.go 10 introduced LOC · 2 ranges

Open complete file

222 }
223
224 > func GetNextScheduledTime(ai *persistencespb.ActivityInfo) time.Time { activity.go
225 > // there are two possible cases:
226 > // * this is the first time activity was scheduled
227 > // * in this case we should use current schedule time
228 > // * this is a retry
229 > // * next scheduled time will be calculated, based on the retry policy and last time when activity was completed
230 >
231 > nextScheduledTime := ai.ScheduledTime.AsTime()
232 > if ai.Attempt > 1 {
233 // calculate new schedule time
234 interval := backoff.ExponentialBackoffAlgorithm(ai.RetryInitialInterval, ai.RetryBackoffCoefficient, ai.Attempt)
242 }
243 }
244 > return nextScheduledTime activity.go
245 }
246