Archived

This forum has been archived. Please start a new discussion on GitHub.

timeout

Hi,

could I ask to clarify how timeouts work.
I wrote a small test in which the client calls a server method (Linux, gcc 3.2.3).
On the client side (implemented via Ice::Application) I set up the timeout of 2 sec.
The server method contains 'sleep(20)' to sleep 20 sec.
When I run the client I do get the Ice::TimeoutException in 2 sec but
after this the program hangs up and doesn't respond even on Ctrl-C during
remaining 18 sec. Is it intended behaviour ?
How can I force the client to exit ?

Thanks, Nikolai

Comments

  • marc
    marc Florida
    Try increasing the number of threads in the server side thread pool (e.g., Ice.Server.ThreadPool.Size=2). By default, it's just one thread, and in your case, this thread hangs in the 20-seconds sleep, so no other thread is available to react to the close connection message from the client.

    You can also forcefully kill the client with ctrl-c, but then you cannot use the Application helper class. The Application helper class does a graceful shutdown upon ctrl-c, meaning that it will wait until the server reacts to the connection closure request.
  • Hi Marc,

    thanks, your advice to increase the server side thread pool helped.
    Although not exactly as you recommended.
    My server is implemented as Ice::Service and when I set 'Ice.ThreadPool.Server.Size=2'
    ('Ice.Server.ThreadPool.Size' was a mistyping)
    I got the flollowing message:

    warning: thread pool 'Ice.ThreadPool.Server' is running low on threads
    Size=2, SizeMax=2, SizeWarn=1

    So, I decided that Ice::Service already runs more than one thread and increased
    Ice.ThreadPool.Server.Size significantly. It helped.

    Two more questions:
    1. What is the default number of threads for Ice::Service ?
    2. What's the meaning of the parameters returned in the above warning message ?
    In particular, how 'SizeWarn' is calculated ?
    This parameter is important for me because I can estimate the load of my server and want to set
    a reasonable value to SizeWarn, but I can do it for 'SizeMax' only.

    Cheers, Nikolai
  • marc
    marc Florida
    Please have a look at the Ice manual, chapter "C.6 Ice Thread Pool Properties". This should answer all your questions about thread pool properties.
  • Sorry, Marc, just before getting the reply from you I found the answer on my second question
    in the Manual.
    Thanks, Nikolai