[erlang-questions] calling process hang when calling gen_server call

shehan <>
Sat Nov 14 03:45:34 CET 2009


Hi Evens,

If timeout is happened, no problem to process. The problem is timeout is
also not happen. In client side, all those conditions are handling. When
checking both side logs in problem times, client request is log in server
side. (Remote server) Also server is send result to client. But in client
side, nothing is log with relavent to that result. At least timeout, crash
report is not in the logs. Other thing is, problem is not happen to other
client machine. (Erlang version is 5.6.5) 

I also check /var/log/message logs in the client & server machines (Linux
environment). But unable to find anything at that problem times.  

 

Br,

Sheh

 

-----Original Message-----
From: Evans, Matthew [mailto:] 
Sent: Saturday, November 14, 2009 2:06 AM
To: shehan; 
Subject: RE: [erlang-questions] calling process hang when calling gen_server
call

 

Hi,

 

Do you mean the gen_server:call blocks for longer than the 1 second timeout,
or do you mean the gen_server:call times out?

 

If it's the latter the obvious problem is some kind of network glitch on
that host.

 

If your calling process can't afford to block then maybe you need to
consider an asynchronous call instead. Use gen_server:cast (don't forget to
send the pid of the calling process in themessage) and have the server
process the request and send a reply back with another gen_server:cast to
your client. Maybe include some sort negative ack logic in the
reply/response so you can be sure that the server isn't occasionally
dropping requests.

 

 

-----Original Message-----

From:  [mailto:] On
Behalf Of shehan

Sent: Thursday, November 12, 2009 5:55 AM

To: 

Subject: [erlang-questions] calling process hang when calling gen_server
call

 

Hi all,

 

I use below function in erlang progarm to get numbers from remote server.

(Around 2-5 gen calls/sec) When it was called, some times calling process

was hang. (few seconds per day)  At least crash report is also not printed.

(Local server's Erlang version is 5.5.5. Remote server Erlang version is

5.6.2. Also both are in same network) S

 

 

 

But I use same function in another server (around 2-5 gen calls/sec) &

calling process was not hang. (Local server's Erlang version is 5.6.5.

Remote server Erlang version is 5.6.2. Both are not in same network)

 

 

 

Is there any suggestion to solve above error??  

 

 

 

case catch gen_server:call({local_process_name, }, {get_num,

{Para1, Para2}}, 1000) of

 

{'EXIT', ErrorExit} ->       

 

io:fwrite("ErrorExit ~p~n",[ErrorExit]),

 

                        crash_error;

 

            {get_num, Num} ->                                

 

            Num;

 

            {error, timeout} ->       

 

                        timeout;

 

             _ ->

 

other_error

 

end.

 

 

 

Sheh

 



More information about the erlang-questions mailing list