mutable_state_impl.go ×5

Frontier kind: Code frontier

unlabeled · c_9f1db59823d5

12 tests · 6592 LOC · 224 files · introduces 0 tests · 35 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges35 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1269 ranges6592 lines · 224 files · Browse complete extent
All tests (intent)
12 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: 35 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/workflow/mutable_state_impl.go 35 introduced LOC · 5 ranges

Open complete file

5381 workflowTaskCompletedEventID int64,
5382 command *commandpb.StartTimerCommandAttributes,
5383 > ) (*historypb.HistoryEvent, *persistencespb.TimerInfo, error) { mutable_state_impl.go
5384 > opTag := tag.WorkflowActionTimerStarted
5385 > if err := ms.checkMutability(opTag); err != nil {
5386 return nil, nil, err
5387 }
5388
5389 > timerID := command.GetTimerId() mutable_state_impl.go
5390 > _, ok := ms.GetUserTimerInfo(timerID)
5391 > if ok {
5392 ms.logWarn(mutableStateInvalidHistoryActionMsg, opTag,
5393 tag.WorkflowEventID(ms.GetNextEventID()),
5397 }
5398
5399 > event := ms.hBuilder.AddTimerStartedEvent(workflowTaskCompletedEventID, command) mutable_state_impl.go
5400 > ti, err := ms.ApplyTimerStartedEvent(event)
5401 > if err != nil {
5402 return nil, nil, err
5403 }
5404 > return event, ti, err mutable_state_impl.go
5405 }
5406
5407 func (ms *MutableStateImpl) ApplyTimerStartedEvent(
5408 event *historypb.HistoryEvent,
5409 > ) (*persistencespb.TimerInfo, error) { mutable_state_impl.go
5410 > attributes := event.GetTimerStartedEventAttributes()
5411 > timerID := attributes.GetTimerId()
5412 >
5413 > startToFireTimeout := attributes.GetStartToFireTimeout().AsDuration()
5414 > // TODO: Time skew needs to be taken in to account.
5415 > expiryTime := timestamp.TimeValue(event.GetEventTime()).Add(startToFireTimeout)
5416 >
5417 > ti := &persistencespb.TimerInfo{
5418 > Version: event.GetVersion(),
5419 > TimerId: timerID,
5420 > ExpiryTime: timestamppb.New(expiryTime),
5421 > StartedEventId: event.GetEventId(),
5422 > TaskStatus: TimerTaskStatusNone,
5423 > }
5424 >
5425 > ms.pendingTimerInfoIDs[ti.TimerId] = ti
5426 > ms.pendingTimerEventIDToID[ti.StartedEventId] = ti.TimerId
5427 > ms.updateTimerInfos[ti.TimerId] = ti
5428 > ms.timerInfosUserDataUpdated[ti.TimerId] = struct{}{}
5429 > ms.approximateSize += ti.Size() + len(ti.TimerId)
5430 > ms.executionInfo.UserTimerCount++
5431 >
5432 > return ti, nil
5433 > }
5434
5435 func (ms *MutableStateImpl) AddTimerFiredEvent(