-
Notifications
You must be signed in to change notification settings - Fork 573
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
RequestReplyHelper call-chain exceptions #163
Comments
Oddly enough; this issue stopped manifesting even though the general actor calling pattern remained the same (actually, the number of actors in the chain has increased). |
Ok, let's leave it open for now. |
@roded Has it happened again so far? |
Nope. Maybe close this issue and I'll update once/if it happens again? |
Alright. |
Same issue? Exception in Fiber "fiber-10000011" co.paralleluniverse.actors.LifecycleException: ExitMessage{actor: ActorRef@7753e5bc{AuthActor$$EnhancerByGuice$$75b9cab7@60a91bbe[owner: fiber-10000013]}, cause: null} |
Hi. Are you blocking inside
|
Sorry for the delay. I'm not overriding |
Hi, Edit: |
The As sleeping in the replying actor for a bit mitigates this, I'm guessing that the called actor's |
Hi, |
Hi. You will receive it. Please be patient. |
Hi, I think there's a race condition here that happens if |
Thanks for the confirmation. |
That's precisely what I'm investigating right now, according to what I see it looks like this is not guaranteed but I need to dig deeper. |
I was wrong, it seems to be guaranteed instead but still there is (at least) one problematic trace:
Now, I think the problem is that the |
The |
@circlespainter Isn't this a symptom of a larger issue, where an actor can be unlinked after it has sent an |
@pron I think it is certainly a problem that the As for the larger picture I think it's a matter of behavior definition and I think we can't rely on Erlang as a reference this time because Erlang's default link handling is signal-based while Quasar's is message-based in all cases. The way I see it, in a message-based setting it's correct for an actor to possibly have to deal with a (delayed) But you could also define that an actor has to deal with an It is true that in this specific situation the second definition would make things easier (actually I thought about adopting it) because it's easier for the caller (which has really a predominant role here, not a peer one) to both |
@circlespainter But every actor processes messages based on its own current state, and link/watch unlink/unwatch are directives about the actor's state that influence its default handling of lifecycle messages. Seems perfectly reasonable, no? |
@pron Sure. But why do you think this default would be better? That is, why by default I shouldn't take care of |
@circlespainter Because the entire model is pull rather than push. The whole idea of selective receive, for example, is that the receiver is responsible for defining the order of messages, not the sender(s). That the receiver defines the order is what makes message handling far easier (in terms of managing state) than frameworks where the order is set by the sender(s). Once you unlink/unwatch you signal that you're in a state where you no longer care about lifecycle messages. Whether a message is already in transit or not is entirely accidental. |
@pron I agree about the model but I thought of unlink/unwatch as signalling that you no longer care about care about the actual linked/watched actor's death from that moment on (but not before that), so as a signal about the actual lifecycle event rather than about its message. Does this interpretation make sense or why doesn't it? |
@circlespainter I don't think it makes sense, because whether or not there are messages in transit is accidental. What does it mean "from that moment on"? Wall-clock time? In a concurrent/distributed setting, time is local, and different processes have a different view on time, and wallclock time rarely makes sense. |
@circlespainter Also, to demonstrate the problem with "from that moment on", consider the case where actor A calls unlink at time t0, and while the unlinking is in transit (because, say, actor B is remote), actor B dies at time t1, t1 > t0. So that just doesn't work. The only time that makes sense is for every actor to work in its own local time. |
@pron "From that moment on" would mean "from the moment Or, put another way: with the current default the user actor code receives some information that we'd instead discard with your proposed new default; I see a justification for that only if this information has no meaning, or at least little use, in the "common" case. It's not so easy to define that but I'm trying to see anyway what's the meaning and use (if any) of that information. Maybe you're right, the only important thing is A's interest in B and that's because A is the initiator of the |
But that moment is completely arbitrary from A's perspective. It means that it may or may not accept exit messages after calling unlink/unwatch, and that it will stop getting them some time in the future.
It's not that it has no meaning or no use, but that actor A has put itself in a state that means it is no longer interested in B. |
Yes, but getting it means that B died before the |
@pron In the end it all boils down to what A is I saying it's not interested anymore in when it Actually the reason why the former is preferrable is even more articulate than "because A is the one initiating the So there are really several reasons why your proposed default is better, I think:
I'll close the PR then and try to propose another one implementing a discarding default handler in general for |
Looks good. |
(Copied from: https://groups.google.com/forum/#!topic/quasar-pulsar-user/wkENHH0xAIQ)
If you would consider the following pattern:
The behavior works fine.
However, the following exception (see below) chain is thrown in relation to ExitMessage signaling (?).
This seems like a RequestReplyHelper chain issue.
Is there anything wrong with the code above?
Thanks
java.lang.Object@7f681f5
Exception in Fiber "fiber-10000004" java.lang.RuntimeException
at co.paralleluniverse.common.util.Exceptions.rethrow(Exceptions.java:26)
at co.paralleluniverse.actors.behaviors.RequestReplyHelper$1.handleLifecycleMessage(RequestReplyHelper.java:167)
at co.paralleluniverse.actors.SelectiveReceiveHelper.receive(SelectiveReceiveHelper.java:121)
at co.paralleluniverse.actors.behaviors.RequestReplyHelper.call(RequestReplyHelper.java:174)
at co.paralleluniverse.actors.behaviors.RequestReplyHelper.call(RequestReplyHelper.java:112)
at com.xxx.services.rest.temp.Mid.doRun(Mid.java:17)
at com.xxx.services.rest.temp.Mid.doRun(Mid.java:12)
at co.paralleluniverse.actors.Actor.run0(Actor.java:691)
at co.paralleluniverse.actors.ActorRunner.run(ActorRunner.java:51)
at co.paralleluniverse.fibers.Fiber.run(Fiber.java:1026)
WARNING: Uninstrumented methods (marked '') or call-sites (marked '!!') detected on the call stack:
at co.paralleluniverse.common.util.Exceptions.rethrow(java.lang.Throwable) (Exceptions.java:26 bci: 29) **
at co.paralleluniverse.actors.behaviors.RequestReplyHelper$1.handleLifecycleMessage (RequestReplyHelper.java:167 bci: 41) **
at co.paralleluniverse.actors.SelectiveReceiveHelper.receive (SelectiveReceiveHelper.java:121 bci: 341) !! (instrumented suspendable calls at: [])
at co.paralleluniverse.actors.behaviors.RequestReplyHelper.call (RequestReplyHelper.java:174 bci: 663)
at co.paralleluniverse.actors.behaviors.RequestReplyHelper.call (RequestReplyHelper.java:112 bci: 335)
at com.xxx.services.rest.temp.Mid.doRun (Mid.java:17 bci: 192)
at com.xxx.services.rest.temp.Mid.doRun (Mid.java:12 bci: 1) (optimized)
at co.paralleluniverse.actors.Actor.run0 (Actor.java:691 bci: 222)
at co.paralleluniverse.actors.ActorRunner.run (ActorRunner.java:51 bci: 148)
at co.paralleluniverse.fibers.Fiber.run (Fiber.java:1026 bci: 11)
at co.paralleluniverse.fibers.Fiber.run1 (Fiber.java:1021 bci: 1)
Exception in Fiber "fiber-10000004" java.lang.RuntimeException
at co.paralleluniverse.common.util.Exceptions.rethrow(Exceptions.java:26)
at co.paralleluniverse.actors.behaviors.RequestReplyHelper$1.handleLifecycleMessage(RequestReplyHelper.java:167)
at co.paralleluniverse.actors.SelectiveReceiveHelper.receive(SelectiveReceiveHelper.java:121)
at co.paralleluniverse.actors.behaviors.RequestReplyHelper.call(RequestReplyHelper.java:174)
at co.paralleluniverse.actors.behaviors.RequestReplyHelper.call(RequestReplyHelper.java:112)
at com.xxx.services.rest.temp.Mid.doRun(Mid.java:17)
at com.xxx.services.rest.temp.Mid.doRun(Mid.java:12)
at co.paralleluniverse.actors.Actor.run0(Actor.java:691)
at co.paralleluniverse.actors.ActorRunner.run(ActorRunner.java:51)
at co.paralleluniverse.fibers.Fiber.run(Fiber.java:1026)
WARNING: Uninstrumented methods (marked '') or call-sites (marked '!!') detected on the call stack:
at co.paralleluniverse.common.util.Exceptions.rethrow(java.lang.Throwable) (Exceptions.java:26 bci: 29) **
at co.paralleluniverse.actors.behaviors.RequestReplyHelper$1.handleLifecycleMessage (RequestReplyHelper.java:167 bci: 41) **
at co.paralleluniverse.actors.SelectiveReceiveHelper.receive (SelectiveReceiveHelper.java:121 bci: 341) !! (instrumented suspendable calls at: [])
at co.paralleluniverse.actors.behaviors.RequestReplyHelper.call (RequestReplyHelper.java:174 bci: 663)
at co.paralleluniverse.actors.behaviors.RequestReplyHelper.call (RequestReplyHelper.java:112 bci: 335)
at com.xxx.services.rest.temp.Mid.doRun (Mid.java:17 bci: 192)
at com.xxx.services.rest.temp.Mid.doRun (Mid.java:12 bci: 1) (optimized)
at co.paralleluniverse.actors.Actor.run0 (Actor.java:691 bci: 222)
at co.paralleluniverse.actors.ActorRunner.run (ActorRunner.java:51 bci: 148)
at co.paralleluniverse.fibers.Fiber.run (Fiber.java:1026 bci: 11)
at co.paralleluniverse.fibers.Fiber.run1 (Fiber.java:1021 bci: 1)
The text was updated successfully, but these errors were encountered: