temporalio / temporalio/temporal

Signal to self error in Workflow code

Open
#682 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

difficulty: easy enhancement up-for-grabs
Dominant language
Go
Stars
23.2k
Forks
1.9k
Avg merge
2d 8h
Merged PRs (30d)
228

Description

Expected Behavior

A workflow should be able to signal any workflow using a workflow ID, including itself.

Actual Behavior

Throws a UnknownExternalWorkflowExecution when attempting to signal itself.

Steps to Reproduce the Problem

  1. Try the following workflow code:
func TestWorkflow(ctx workflow.Context) error {
	we := workflow.GetInfo(ctx).WorkflowExecution
	err := workflow.SignalExternalWorkflow(ctx, we.ID, we.RunID, "messages", "hello").Get(ctx, nil)
	if err != nil {
		panic(fmt.Errorf("could not signal external workflow: %v", err))
	}
	return nil
}
  1. Error shows in temporal web history:
    image

  2. The worker logs the error:

2020/08/18 21:29:57 ERROR Workflow panic. Namespace default TaskQueue test WorkerID 465773@beast-ubuntu@ WorkflowID TestWorkflow RunID 254db1e2-ebcc-489a-9835-1f5e2e3fb8f8 PanicError could not signal external workflow: UnknownExternalWorkflowExecution PanicStack coroutine root [panic]:
myproject.com/domain/root.TestWorkflow(0x1003500, 0xc000498a00, 0x0, 0x0)
        /home/paul/myproject.com/domain/root/testworkflow.go:41 +0x17a
reflect.Value.call(0xd69c40, 0xefbd48, 0x13, 0xeaf2fa, 0x4, 0xc000486de0, 0x1, 0x1, 0xfd2270, 0xe8e420, ...)
        /usr/local/go/src/reflect/value.go:460 +0x8ab
reflect.Value.Call(0xd69c40, 0xefbd48, 0x13, 0xc000486de0, 0x1, 0x1, 0xfd2270, 0xe8e420, 0xc0004b4640)
        /usr/local/go/src/reflect/value.go:321 +0xb4
go.temporal.io/sdk/internal.(*workflowEnvironmentInterceptor).ExecuteWorkflow(0xc0004b4640, 0x1003500, 0xc000498a00, 0xc0000362c0, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/paul/go-sdk/internal/workflow.go:370 +0x2b2
go.temporal.io/sdk/internal.(*workflowExecutor).Execute(0xc000498940, 0x1003500, 0xc000498a00, 0x0, 0xc0004f3738, 0xc68596, 0x0)
        /home/paul/go-sdk/internal/internal_worker.go:759 +0x334
go.temporal.io/sdk/internal.(*syncWorkflowDefinition).Execute.func1(0x10036c0, 0xc00009b0e0)
        /home/paul/go-sdk/internal/internal_workflow.go:491 +0xf3
^C2020/08/18 21:30:00 INFO  Stopped Worker Namespace default TaskQueue test WorkerID 465773@beast-ubuntu@

Specifications

  • Version: 0.28.0
  • Platform: Helm-chart

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with workflow.SignalExternalWorkflow using the current workflow ID and run ID, then inspect the Temporal service path that handles the self-signal. Compare the worker error with the temporal web history. Done means a workflow can signal itself without UnknownExternalWorkflowExecution.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.