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

Support alias disabling during workflow/activity registration #850

Merged
merged 2 commits into from
Jul 14, 2022

Conversation

cretz
Copy link
Member

@cretz cretz commented Jul 8, 2022

What was changed

Add worker.Options.DisableRegistrationAliasing (and worker.WorkflowReplayerOptions.DisableRegistrationAliasing and testsuite.WorkflowTestSuite.DisableRegistrationAliasing) to opt-out of registration aliasing which we strongly recommend (I would love to make this default, but can't due to compatibility concerns).

Why?

Did you know that today, if you register foo() with custom name "bar" and register baz() with custom name "foo", when you invoke using the string name "foo", you will actually execute foo()?

Did you know that today, if you register pkga.foo() with no custom name and then register pkgb.foo() with custom name "bar", when you invoke using the function reference pkga.foo, you will actually call pkgb.foo()?

This is wrong but unchangeable since people may inadvertently rely on such behavior. Rather, we now have a way to opt-out of this bad behavior. It is that second "Did you know" above that is the justification for putting this as a worker-level option instead of a register-option when registering.

Checklist

  1. Closes Allow disabling of function name aliasing during registration #672
  2. Closes Activity function alias lookup is done even on different task queue #845

@cretz cretz merged commit 16cc53e into temporalio:master Jul 14, 2022
@cretz cretz deleted the disable-alias branch July 14, 2022 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants