ActorDispatcher finds the actor for a dispatch through dispatch_identity(dispatch), which is MergeStrategy.identity() when a merge strategy is used. MergeByTypeTarget puts the dispatch target in the identity, and target can be updated on a running dispatch.
When that happens, the running-state event carries the new identity, so _start_actor() creates a second actor for the new target, and the actor for the old target is never stopped. When the dispatch ends, the stop event also uses the new identity, so only the new actor is stopped. The old one keeps acting on the old target until the process restarts.
MergeByType isn't affected, because its identity only uses type and dry_run, which the API doesn't allow updating. A custom strategy whose identity uses any other updatable field is affected the same way.
What did you expect instead?
When an update moves a running dispatch to a different identity, the actor for the old identity should be stopped (unless another running dispatch still maps to it), and the actor for the new identity started or updated.
Affected version(s)
v1.0.4
Affected part(s)
Actor (part:actor)
Extra information
ActorDispatcher only sees the updated Dispatch, so it can't know the previous identity. It probably needs to remember the identity each dispatch ID currently maps to, and treat a change as a stop for the old identity plus a start for the new one, respecting the merge strategy's filter() so other dispatches that keep the old identity running aren't affected.
Activity