Skip to content
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

Inconsistent Activity Alias Mapping Behavior Across Multiple Task Queues #1275

Closed
MMN3003 opened this issue Oct 21, 2023 · 2 comments
Closed

Comments

@MMN3003
Copy link

MMN3003 commented Oct 21, 2023

Expected Behavior

The getActivityAlias function should not be called or should return an appropriate response when invoked for an activity that belongs to a different task queue. It should only provide an alias mapping for activities that are registered within the same task queue context. This behavior ensures that activity alias mapping is confined to the specific task queue where the activity is registered and does not provide an alias for activities in different task queues.

Actual Behavior

Currently, the getActivityAlias function is called for activities regardless of the task queue they belong to. It provides alias mapping even when the activity is invoked from a different task queue context, which may lead to incorrect alias mapping and behavior that does not align with the original task queue registration. This can result in unexpected or incorrect behavior when trying to retrieve alias information for activities that are not associated with the current task queue.

Steps to Reproduce the Problem

1.Create two distinct task queues, let's call them "QueueA" and "QueueB," within your Temporal application.
2.Register an activity with an alias in each of these task queues. For example

// Activity registration in QueueA (workerA) 
worker.RegisterActivityWithOptions(ActivityA, activity.RegisterOptions{Name: "Name"})

  // Activity registration in QueueB (workerB) 
worker.RegisterActivityWithOptions(Name, activity.RegisterOptions{Name: "OtherName"})

3.In your Temporal workflow, initiate an activity invocation from one task queue but specify an activity that belongs to a different task queue. For example, invoke "ActivityA" from "QueueA" with alias name in a workflow that is running in "QueueB."

// workflow with original task queue "QueueB"
activityOptions := &workflow.ActivityOptions{
              ...
  	TaskQueue:  "QueueA",
  	...
  }
  ctx = workflow.WithActivityOptions(ctx, *activityOptions)
  workflow.ExecuteActivity(ctx, "Name", data).Get(ctx, nil)

getActivityAlias in ExecuteActivity returns OtherName as alias!!

  • Version: go.temporal.io/sdk v1.25.1
  • Platform: linux
@yiminc yiminc transferred this issue from temporalio/temporal Oct 21, 2023
@cretz
Copy link
Member

cretz commented Oct 23, 2023

Duplicate of #845.

Yes, we use the workflow's registry to lookup activity aliases. We can't really change this behavior without potentially breaking people. So we created #850 for this situation. We recommend you disable aliasing via the DisableRegistrationAliasing option.

@Quinn-With-Two-Ns
Copy link
Contributor

Closing as duplicate of #845

@Quinn-With-Two-Ns Quinn-With-Two-Ns closed this as not planned Won't fix, can't repro, duplicate, stale Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants