-
Notifications
You must be signed in to change notification settings - Fork 911
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
Use namespace from schedule activity worker #3680
Conversation
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.
Most of the activities are used as local activities (except the WatchWorkflow which could be used by regular activity), we probably should not register them as regular activity (thus remove the possibility from been invoked by user code.)
Good idea. But I don't see how to do it: If I don't register them at all, then running local activities doesn't work (because they're not registered with the actual struct instance and I can't get it from the workflow). If I register them like this:
then it looks like it registers them with an external name anyway (based on this code: https://github.com/temporalio/sdk-go/blob/dbb8e5471b98e090a41bcd64b1261d66e5fefe23/internal/internal_worker.go#L556-L574) Is there a trick I'm missing? |
Local activity does not require registration. You can access local activity from within workflow as:
|
But then the receiver ( |
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.
This PR is good to go. We can work on activity to local activity in separate PR.
What changed?
In the scheduler workflow activities, instead of checking that namespace + namespace id match, just use the namespace + id that's known to the activity worker.
Why?
This reduces the chance of security bugs resulting from forgetting checks.
How did you test it?
CI
Potential risks
Changing activity inputs does not break determinism, so the workflow should be compatible (verified with a local test).
Is hotfix candidate?