Hacker News new | ask | show | jobs
by snowboarder63 1212 days ago
Yeah hot upgrades is something we'd love to get to, but probably won't be able to swing in a compiled language. We had worked out something ugly back in the day in a .net style environment (different library at a different job), but it still didn't compare to Erlang's hot upgrade flow.
2 comments

So a problem I noticed, is you pass mutable state to the actor.

What happens if the actor mutates the state then fails?

Do you just dirty the state and throw it away or do you retry at all?

If the actor fails, it could have failed mid-mutation so we can't trust the "state" object. This would be the same if we passed in an owned state (rather than a mutable reference) and the handler didn't reply with a new state object. If a failure happens, the state is dropped there too (in Rust). I know it's not exactly how Erlang handles it, but it's a tradeoff we've accepted in this case. We're open to suggestions however!
It looks like lunatic has a solution? Not very familiar with the project, but maybe worth checking out.
They don't, at least not yet. https://github.com/lunatic-solutions/lunatic/issues/150

It is WebAssembly based though, so it should be easier than trying to deal with dynamic libraries and Rust's ABI.