Skip to content

chore: Clearer Temporal connection and missing-versioning-behavior errors#769

Merged
rustatian merged 6 commits into
masterfrom
fix/temporal-connect-error-and-versioning
Jun 2, 2026
Merged

chore: Clearer Temporal connection and missing-versioning-behavior errors#769
rustatian merged 6 commits into
masterfrom
fix/temporal-connect-error-and-versioning

Conversation

@rustatian

@rustatian rustatian commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Two error-clarity fixes in the Temporal plugin.

  • Connection failures now report the server address and underlying cause instead of a bare temporal_plugin_serve: context deadline exceeded — e.g. failed to connect to the Temporal server at "localhost:7233": context deadline exceeded; ensure it is reachable and ready to accept connections.
  • Invalid workflow registration (e.g. worker versioning enabled but a workflow has no VersioningBehavior) now fails worker init with a clear, workflow-named error instead of crashing the process on an SDK panic.

closes roadrunner-server/roadrunner#2278
closes roadrunner-server/roadrunner#2237

rustatian added 2 commits June 1, 2026 22:17
Wrap the client Dial error with the target address, the underlying cause, and a readiness hint instead of returning it bare, so a failed 'rr serve' reports the address and reason rather than an opaque 'temporal_plugin_serve: context deadline exceeded'.

Ref: roadrunner-server/roadrunner#2278
When worker versioning is enabled (DeploymentOptions.UseVersioning with a deployment version) and no worker default behavior is set, the Temporal SDK panics inside RegisterWorkflowWithOptions if a workflow has no VersioningBehavior, crashing the worker. Validate up front and return a descriptive error naming the workflow and task queue instead.

Ref: roadrunner-server/roadrunner#2237
Copilot AI review requested due to automatic review settings June 1, 2026 20:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves error clarity in the Temporal plugin in two situations: connection failures and missing workflow versioning behavior. Both fixes extract small pure helpers covered by unit tests.

Changes:

  • Wrap tclient.Dial errors with target address, underlying cause, and a readiness hint via a new connectError helper.
  • Add validateVersioningBehavior to pre-empt the Temporal SDK panic when worker versioning is enabled without a default or per-workflow behavior, returning a descriptive error naming the workflow and task queue.
  • Add unit tests for both helpers.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
internal.go Wraps Dial errors with the new connectError helper.
internal_test.go Adds unit test for connectError.
aggregatedpool/workers.go Adds validateVersioningBehavior and calls it before RegisterWorkflowWithOptions.
aggregatedpool/workers_test.go Adds unit tests covering versioning validation paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rustatian rustatian self-assigned this Jun 1, 2026
rustatian added 2 commits June 1, 2026 22:30
…ioning

Note that the deprecated UseBuildIDForVersioning flag is intentionally out of scope; the supported DeploymentOptions.UseVersioning path is fully covered.
…he condition

RegisterWorkflowWithOptions panics on invalid versioning config rather than returning an error. The previous guard mirrored the SDK's internal panic condition, which is a standing sync obligation against a private internal and drifts silently. Wrap registration in a recover that converts any panic into a clean, workflow-named init error. Correctness no longer depends on any SDK-internal condition or message; the missing-versioning-behavior case still gets a tailored hint and degrades gracefully otherwise. This also covers the deprecated UseBuildIDForVersioning path for free.

Ref: roadrunner-server/roadrunner#2237
@rustatian rustatian changed the title Clearer Temporal connection and missing-versioning-behavior errors chore: Clearer Temporal connection and missing-versioning-behavior errors Jun 2, 2026
rustatian added 2 commits June 2, 2026 18:26
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
@rustatian rustatian merged commit 0d2719c into master Jun 2, 2026
12 checks passed
@rustatian rustatian deleted the fix/temporal-connect-error-and-versioning branch June 2, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🧹 CHORE]: Improve Temporal connection error description [💡 FEATURE REQUEST]: Friendly exception text on missing Workflow behavior

3 participants