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
Finalizers which suspend are terminated immediately #212
Comments
Marking the |
That's a good question... I was digging through the commit history trying to find why I made that change originally, and couldn't find it. I think it'd make more sense to either run the finalizer in exclusive mode, or as you said, raise if anything attempts to suspend the current task. |
seems run finalizer in exclusive is better, user can just care the actor is alive or dead, not other. |
@jjyr i would prefer to be able to detect the attempt to suspend. What do you mean by?
|
@halorgium i mean when i call the actor, i expected it be alive or dead, but not |
@jjyr the main problem I foresee is that at some point we will have to suspend the finalizer and allow new messages to arrive and be handled in the case of shutting down a tree of actors. |
@halorgium yes..i did not notice that...:neutral_face: |
@jjyr do not worry, I am glad you have been providing feedback and looking at the code. |
A lot of things in Akka and Erlang are still uncertain and probably |
This is also true. |
Task termination now logs, so users should make their finalizers exclusive if they need this behavior. |
When a finalizer runs and it's
Task
suspended, the finalizer is killed immediately after that time by theActor#cleanup
code.In supervision groups, the finalizer is responsible for terminating other actors, which uses a
SyncCall
which suspends the task.The main problem is that there is no more main loop to handle responses to method calls after the
shutdown
has started.This has implications and confusions on @jruby where Threads seem to stick around if you have
ConditionVariables
in use. See #203The text was updated successfully, but these errors were encountered: