[erlang-questions] Lost messages

George Xu xuxiang1@REDACTED
Tue Jul 28 02:07:22 CEST 2009


Yes,I already do the link and clean ETS table work. But no one can solve 
the race condition I think. 

So, in very rare case, I lost the message ('EXIT' is arrived after the 
message send out). 

I think this is not a "erLang way". It shall occur an error and let the 
sending process exit. 

Because that the message is important and the router which collect 
messages and send out can not be blocked by a dead / exit process, send a 
message back is not an acceptale solution.

Does anyone have solutions for this?

━━━━━━━━━━━━━━━━━━━━━━━━━━
徐翔 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



Attila Rajmund Nohl <attila.r.nohl@REDACTED> 
Sent by: <erlang-questions@REDACTED>
2009-07-27 20:39

To
Mazen Harake <mazen.harake@REDACTED>
cc
George Xu <xuxiang1@REDACTED>, erlang-questions@REDACTED
Subject
Re: [erlang-questions] Lost messages







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
>
>

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org





More information about the erlang-questions mailing list