api.go ×6

Frontier kind: Code frontier

unlabeled · c_e3ebf0f7194b

64 tests · 6525 LOC · 203 files · introduces 0 tests · 29 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges29 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1348 ranges6525 lines · 203 files · Browse complete extent
All tests (intent)
64 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: 29 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/api/respondworkflowtaskcompleted/api.go 29 introduced LOC · 6 ranges

Open complete file

219 }
220
221 > behavior := request.GetVersioningBehavior() api.go
222 > deployment := worker_versioning.DeploymentFromDeploymentVersion(worker_versioning.DeploymentVersionFromOptions(request.GetDeploymentOptions()))
223 > //nolint:staticcheck // SA1019 deprecated Deployment will clean up later
224 > if behavior != enumspb.VERSIONING_BEHAVIOR_UNSPECIFIED && request.GetDeployment() == nil &&
225 > (request.GetDeploymentOptions() == nil || request.GetDeploymentOptions().GetWorkerVersioningMode() != enumspb.WORKER_VERSIONING_MODE_VERSIONED) {
226 // Mutable state wasn't changed yet and doesn't have to be cleared.
227 releaseLeaseWithError = false
229 }
230
231 > assignedBuildId := ms.GetAssignedBuildId() api.go
232 > wftCompletedBuildId := request.GetWorkerVersionStamp().GetBuildId()
233 > if assignedBuildId != "" && !ms.IsStickyTaskQueueSet() {
234 // Worker versioning is used, make sure the task was completed by the right build ID, unless we're using a
235 // sticky queue in which case Matching will not send the build ID until old versioning is cleaned up
243 }
244
245 > var effects effect.Buffer api.go
246 > defer func() {
247 > // `effects` are canceled immediately on WFT failure or persistence errors.
248 > // This `defer` handles rare cases where an error is returned but the cancellation didn't happen.
249 > if retError != nil {
250 cancelled := effects.Cancel(ctx)
251 if cancelled {
261 // TODO(carlydf): change condition when deprecating versionstamp
262 // It's an error if the workflow has used versioning in the past but this task has no versioning info.
263 > if ms.GetMostRecentWorkerVersionStamp().GetUseVersioning() && api.go
264 > //nolint:staticcheck // SA1019 deprecated stamp will clean up later
265 > !request.GetWorkerVersionStamp().GetUseVersioning() &&
266 > request.GetDeploymentOptions().GetWorkerVersioningMode() != enumspb.WORKER_VERSIONING_MODE_VERSIONED &&
267 > // This check is not needed for V3 versioning
268 > ms.GetEffectiveVersioningBehavior() == enumspb.VERSIONING_BEHAVIOR_UNSPECIFIED {
269 // Mutable state wasn't changed yet and doesn't have to be cleared.
270 releaseLeaseWithError = false
272 }
273
274 > nsName := namespaceEntry.Name().String() api.go
275 >
276 > // When pagination is enabled, buffer intermediate pages and merge them into the final page
277 > // before continuing through the normal workflow task completion path.
278 > paginationResp, mergedCommands, err := handler.applyTaskCompletionPagination(weContext, token, request, nsName)
279 > // In case of a buffer overflow fall through and fail the workflow task below
280 > paginationOverflow := errors.Is(err, workflow.ErrTaskCompletionBufferSizeExceeded)
281 > if !paginationOverflow && (paginationResp != nil || err != nil) {
282 releaseLeaseWithError = false
283 return paginationResp, err
829 request *workflowservice.RespondWorkflowTaskCompletedRequest,
830 nsName string,
831 > ) (resp *historyservice.RespondWorkflowTaskCompletedResponse, mergedCommands []*commandpb.Command, err error) { api.go
832 > if !handler.config.EnableWorkflowTaskCompletionPagination(nsName) {
833 if request.GetIntermediatePage() || request.GetPageNumber() > 0 {
834 return nil, nil, serviceerror.NewFailedPreconditionf(