[Pitch] Distributed Actor Runtime

While working on Isolated synchronous deinit, I was digging into failing tests, and looks like current implementation of distributed actor runtime calls deinit both for local actor and for remote proxy. Which was surprising, I would expect deinit to be called only for local actor. Is this intentional or still a WIP? I did not find anything in the proposal text about this.

My proposal lifts restrictions on deinit, allowing it to access all the actor's properties, including those of non-Sendable types. Such deinit does not make sense for a remote proxy.

Another small note: proposal discourages storing strong references to actors in the ID -> actor mapping, but unowned references also cannot be used. Using unsafe/unowned references and relying on resignID() would be racy. Regardless of deinit isolation, there is a time window when object is already dead, but deinit did not start executing yet. Implementation of the ActorSystem must use weak references and handle dead reference for ID's which are not yet resigned.

1 Like