-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Improve versioning error messages, return NotFound gRPC error for all not found errors #8641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…shahab/sync-apis # Conflicts: # api/deployment/v1/message.pb.go # tests/versioning_3_test.go
# Conflicts: # proto/internal/temporal/server/api/deployment/v1/message.proto # tests/versioning_3_test.go
… not found errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Ramping crashes on empty version configuration
In SetRampingVersion, when version is empty (unsetting ramping) and allowNoPollers is true, versionObj is nil. Calling versionObj.GetBuildId() at line 800 in updateWithStartWorkerDeployment causes a nil pointer dereference. The code should check if versionObj is nil before dereferencing or handle empty version specially.
service/worker/workerdeployment/client.go#L792-L803
temporal/service/worker/workerdeployment/client.go
Lines 792 to 803 in d572f69
| deploymentName, | |
| versionObj.GetBuildId(), | |
| &updatepb.Request{ | |
| Input: &updatepb.Input{Name: SetRampingVersion, Args: updatePayload}, | |
| Meta: &updatepb.Meta{UpdateId: updateID, Identity: identity}, | |
| }, | |
| identity, | |
| requestID, | |
| d.getSyncBatchSize(), | |
| ) | |
| if err != nil { | |
| return nil, err |
What changed?
Improve versioning error messages, return NotFound gRPC error for all not found errors
Why?
So that users can see if they mispelled a deployment name or build id, and generally know which versions are involved when there is an error
How did you test it?
Potential risks
Changing the error returned only affected replay if the type of error changes, not the string. I am keeping the type the same in the few places where I had to change the error string, so it won't affect workflow replay.
Error messages are not compared when checking order of commands in workflow replay check in Go SDK here: https://github.com/temporalio/sdk-go/blob/ad990a3bfe17560c82cf84c80dfdf6c41eb43580/internal/internal_task_handlers.go#L1616
Note
Standardizes NotFound errors and makes worker deployment/version errors more informative (include deployment/build IDs), with corresponding workflow validations and test updates.
NotFoundfor missing deployments/versions (e.g.,ErrWorkerDeploymentNotFound,ErrWorkerDeploymentVersionNotFound), replacing priorFailedPreconditionin those cases.build_id, deployment name); add formatted messages for draining/has-pollers/current-or-ramping; introduce suffix constants and string matching to map workflow failures to precise non-retryable errors.SetCurrentVersion,SetRampingVersion,DescribeVersion,DeleteVersionFromWorkerDeployment, and update handling (handleUpdateVersionFailures).FailedPreconditionfwith version details for missing task queues, manager identity mismatch, and current/ramping delete checks.NotFoundusage and formatted messages; update assertions to useFailedPreconditionfmessage strings.Written by Cursor Bugbot for commit 5bb0b22. This will update automatically on new commits. Configure here.