slawlor / ractor

Rust actor framework
MIT License
1.52k stars 73 forks source link

Adding handling if the actor fails during pre_start that it doesn't poison the named and pid registries. #243

Closed slawlor closed 5 months ago

slawlor commented 5 months ago

Handling actor startup errors in pre_start results in a SpawnErr however it wasn't being handled putting the actor into a Stopped state (which it should have), since that's where the actor registries are cleaned up such as the named and pg registries. This would result in dangling references in those registries.

This PR specifically captures spawn failures and sets the actor to stopped to call the necessary de-registration hooks.

Resolves #240