Hi,
I have added some new changes to our workflow and we added version logic as explained here: Versioning | Temporal Documentation
final var version = Workflow.getVersion("new_changes", Workflow.DEFAULT_VERSION, 1);
if (version == 1) {
newActivity.executeNewActivity();
}
We deployed the changes and in one of our workflows we found the next error:
java.lang.IllegalArgumentException: Activity Type "ExecuteNewActivity" is not registered with a worker. Known types are: Activity1, Activity2, Activity3.
That error was triggered by a worker with the old code, which does not have the activity registered, but I wasn’t expecting that the new activity would be picked from an old worker ![]()
I guess this behavior makes sense, since the new worker would have push the new activity to the activity task queue and randomly it was picked by an old worker (there is a small race condition in which both workers are polling during a deployment), but my question is… can this be avoided somehow? Or should we just acknowledge the behavior and rely on the retries for that?
Regards, Diego.