api.go ×4

Frontier kind: Joint frontier

unlabeled · c_23493b6674eb

1 test · 10232 LOC · 261 files · introduces 1 test · 29 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges29 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
2300 ranges10232 lines · 261 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: 29 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/api/respondworkflowtaskcompleted/api.go 23 introduced LOC · 4 ranges

Open complete file

172 }
173 if retError != nil && currentWorkflowTask != nil && currentWorkflowTask.Type == enumsspb.WORKFLOW_TASK_TYPE_SPECULATIVE && ms.IsStickyTaskQueueSet() {
174 > // If, while completing WFT, error is occurred and returned to the worker then worker will clear its cache. api.go
175 > // New WFT will also be created on sticky task queue and sent to worker.
176 > // Because worker doesn't have a workflow in cache, it needs to replay it from the beginning,
177 > // but sticky WFT has only partial history. Worker will request full history using GetWorkflowExecutionHistory API.
178 > // This history doesn't have speculative WFT events. If WFT is speculative,
179 > // then worker will see inconsistency between history from it and full history, and will fail WFT.
180 > //
181 > // To prevent unexpected WFT failure, server clears stickiness for this workflow, next WFT will go to normal task queue,
182 > // and will have full history attached to it.
183 > // This is NOT 100% bulletproof solution because this write operation may also fail.
184 > // TODO: remove this call when GetWorkflowExecutionHistory includes speculative WFT events.
185 > if clearStickyErr := handler.clearStickyTaskQueue(ctx, workflowLease.GetContext()); clearStickyErr != nil {
186 handler.logger.Error("Failed to clear stickiness after speculative workflow task failed to complete.",
187 tag.NewErrorTag("clear-sticky-error", clearStickyErr),
1156 }
1157
1158 > func (handler *WorkflowTaskCompletedHandler) clearStickyTaskQueue(ctx context.Context, wfContext historyi.WorkflowContext) error { api.go
1159 >
1160 > // Clear all changes in the workflow context that was made already.
1161 > wfContext.Clear()
1162 >
1163 > ms, err := wfContext.LoadMutableState(ctx, handler.shardContext)
1164 > if err != nil {
1165 return err
1166 }
1167 > ms.ClearStickyTaskQueue() api.go
1168 > err = wfContext.UpdateWorkflowExecutionAsActive(ctx, handler.shardContext)
1169 > if err != nil {
1170 return err
1171 }
1172 > return nil api.go
1173 }
go.temporal.io/server/common/testing/testvars/test_vars.go 6 introduced LOC · 1 range

Open complete file

333 }
334
335 > func (tv *TestVars) StickyExecutionAttributes(timeout time.Duration) *taskqueuepb.StickyExecutionAttributes { test_vars.go
336 > return &taskqueuepb.StickyExecutionAttributes{
337 > WorkerTaskQueue: tv.StickyTaskQueue(),
338 > ScheduleToStartTimeout: durationpb.New(timeout),
339 > }
340 > }
341
342 func (tv *TestVars) WorkflowType() *commonpb.WorkflowType {