Hi Roger,

I thought that each message was delivered in sequence, which I'm pretty
> sure I've seen described on a few places (?)
>

Each *user *message is delivered in sequence. System messages are not
something that are observable by user code directly and they use separate
mechanisms -- it is completely internal.


>
>
> If I get things right, what will happen here is that 1000 "hello" messages
> will be passed to ActorA pretty quickly.
> that is, the queue will fill up in very fast.
>
> once the first message arrives to onReceive, it will be forwarded to
> ActorB, which throws because it is broken.
> if B tries to notify A of this without priority, the message would be
> placed at the end of the ActorA mailbox.
>

The failure notification is not a user message, so it will be handled
separately, not through the user message queue.


>
> But if it is like you say, a priority to supervision messages, then that
> explains it.
> But that makes me curious on how that is handled?
> Is the mailbox a priority queue?
>

I used "priority" in quotes because this does not imply that the user
message queue is a priority queue. In fact, there is a separate "queue" for
system messages internally. I again had to use quotes since how that
"queue" is implemented is quite tricky.


>
> Why I'm asking is that since I'm playing around with my .NET port of akka,
> I got the described above behavior. and I wondered how it is solved in real
> Akka and could not find any explanation in the code.
>

Ah, OK. If so, then welcome to the Dungeon :) Things are pretty tricky from
here, there are multiple places where you should look:

System messages:
https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/dispatch/sysmsg/SystemMessage.scala

Mailbox.run:
https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala#L215

How system and user messages are handled:
https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/actor/ActorCell.scala#L422
https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/actor/ActorCell.scala#L457

-Endre



>
>
>
>
> Den tisdagen den 7:e januari 2014 kl. 11:43:13 UTC+1 skrev drewhk:
>>
>> Hi Roger,
>>
>> I am also a bit unsure about the question, but system messages (the
>> messages used by supervision for example) are handled with "priority"
>> compared to user messages. I am not sure this answers your question though.
>>
>> -Endre
>>
>>
>> On Tue, Jan 7, 2014 at 11:06 AM, √iktor Ҡlang <[email protected]>wrote:
>>
>>> Not sure I follow, can you create a code sample in Akka that shows the
>>> perceived problem?
>>>
>>>
>>> On Tue, Jan 7, 2014 at 8:45 AM, Roger Alsing <[email protected]> wrote:
>>>
>>>> How does the supervisor deal with congestion?
>>>>
>>>> Lets say that Actor A sends all it's incoming messages to child Actor B.
>>>> And lets say we pass 1000 messages to actor A, then actor B will
>>>> eventually also get 1000 messages.
>>>> But if B for some reason throws, e.g. on each message, then actor B
>>>> will throw a 1000 times unless stopped.
>>>>
>>>> This is where the supervisor should come in and save us, but if the
>>>> overhead of throwing an exception takes longer than passing 1000 messages
>>>> to actor A.
>>>> Then actor B will not be able to notify it's parent that it has thrown
>>>> before actor A has processed all of the initial 1000 messages.
>>>> Thus, actor B will throw 1000 times because the parent is bussy
>>>> processing those initial messages.
>>>>
>>>> Is this the expected behavior in Akka?
>>>> Or is supervision done w/o passing messages back to the owner?
>>>>
>>>> I assume stopping/removing/restarting children needs to be done in the
>>>> parent actors context and therefore use messaging to notify the parent?
>>>>
>>>>
>>>>  --
>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>> >>>>>>>>>> Search the archives: https://groups.google.com/
>>>> group/akka-user
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Akka User List" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To post to this group, send email to [email protected].
>>>>
>>>> Visit this group at http://groups.google.com/group/akka-user.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>
>>>
>>>
>>> --
>>> Cheers,
>>> √
>>>
>>> * Viktor Klang*
>>> *Director of Engineering*
>>> Typesafe <http://www.typesafe.com/>
>>>
>>> Twitter: @viktorklang
>>>
>>> --
>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>> >>>>>>>>>> Search the archives: https://groups.google.com/
>>> group/akka-user
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Akka User List" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>>
>>> Visit this group at http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: http://akka.io/faq/
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to