Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC - add basic exception details to terminated message #535

Open
sudsy opened this issue Aug 27, 2020 · 5 comments
Open

RFC - add basic exception details to terminated message #535

sudsy opened this issue Aug 27, 2020 · 5 comments

Comments

@sudsy
Copy link
Contributor

sudsy commented Aug 27, 2020

I had a look to see if this has been discussed before and can't seem to find it.

I have found that when working with remote actors, I typically have to watch the remote actor for unexpected terminations and also set up a parallel mechanism for reporting error types / messages back from the remote actor to the supervising actor to decide whether to restart a new remote or fail and report back to the user.

I can see that this parallel mechanism would be avoided if we attached some details of the error to the terminated message such as type, message and stack trace.

Any comments / concerns about doing this?

@rogeralsing
Copy link
Contributor

This one is somewhat tricky, firstly, we need to propagate the exception details over the wire, secondly, it needs to make sense between runtimes. e.g. Go talking to .NET

If it is just plaintext for logging, then absolutely, that can be implemented.
Or, if it's about knowing why someone terminated. e.g. Stopped/Exception/Poisoned that could also be implemented.

Thoughts?

@rogeralsing
Copy link
Contributor

We already have the AddressTerminated Bool on Terminated message.
Maybe we could replace this with a Reason prop with different stathuses.

ActorStopped
ActorPoisoned
ActorStoppedBySupervisor
AddressTerminated

Something like that?

@sudsy
Copy link
Contributor Author

sudsy commented Sep 7, 2020

I think for my purposes the combination of the statuses you have listed above and a simple string that contains the exception message would work. Would that work across the different runtimes?

That way I could propagate an exception message all the way back to the caller if needed.

@rogeralsing
Copy link
Contributor

👍🏻

@rogeralsing
Copy link
Contributor

There are some edge cases that needs to be considered here.
e.g. if you try to Watch an actor that is currently terminating, then you immediately get a Terminated message back, at this point the reason for the termination does not exist anymore, it could be a normal stop, or a failure.

The shutdown process needs to be extended to remember the reason for the full lifecycle of the actor to make this work.

Thinking of the best ways to do this w/o widening the state of the actor context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants