[erlang-questions] Lost messages

Mazen Harake mazen.harake@REDACTED
Mon Jul 27 16:50:42 CEST 2009


Just noticed that I had written "..to avoid this problem.." which was a
bit misleading... you are more then correct :)

/M

Attila Rajmund Nohl wrote:
> The linking itself does not avoid the problem, it just makes it occur
> less often (thus harder to reproduce in case it leads to a bug). If
> the message is sent after the process died, but before the 'EXIT'
> message is received (due to linking), it's still a problem.
>
> By the way, an interesting race condition I've seen a couple of months ago:
> process A links to process B, which in turn links to process C.
> Process A also monitors process C and none of the processes trap
> exits. What happens if process C gets (brutally) killed? The code I
> was fixing was based on the assumption that process A receives the
> {'DOWN', ...} message (because of the monitor), but in real life
> process A was killed before the {'DOWN',...} message was received,
> leading to a bug...
>
> 2009/7/27, Mazen Harake <mazen.harake@REDACTED>:
>   
>> Hi George,
>>
>> I'm curious in which situation you are considering this a problem. Can
>> you please elaborate?
>>
>> Also, if you can, you should somehow link to the processes and clean
>> them up from the ETS table to avoid this problem.
>>
>> Regards,
>>
>> /Mazen
>>
>> George Xu wrote:
>>     
>>> It is said that send message is safe. But I count the problem of lost
>>> message.
>>>
>>> The situation is like this:
>>>
>>> 1. I use a ets table to store all process to be communicated.
>>> 2. But those process will terminated with some cases.
>>> 3. In case of one process is terminated but still not reflected to the ets
>>>
>>> table, send message to this process happened sametimes. It seems the
>>> message is send, but it can not reach since the process is termiated and
>>> the message is lost.
>>>
>>> Anyone knows how to solve this problem?
>>>
>>> ━━━━━━━━━━━━━━━━━━━━━━━━━━
>>> 徐翔 George Xu
>>>
>>> Mobile Internet Service Lab, Lonovo Corp. Research China
>>> Tel:86-10-58866181
>>> E-mail:xuxiang1@REDACTED
>>> No.6 Shang Di West Road, Haidian District,
>>> Beijing, 100085
>>> P.R.China
>>>
>>>       
>> ________________________________________________________________
>> erlang-questions mailing list. See http://www.erlang.org/faq.html
>> erlang-questions (at) erlang.org
>>
>>
>>     



More information about the erlang-questions mailing list