Archived

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

concurrent calls to IceGrid::Admin?

I get IceGrid Registry to hang when calling IceGrid::Admin::startServer() simultaneously from multiple threads of my client. This only happens when the Ice.ThreadPool.Client.SizeMax>1 (e.g. 5) is set for the Registry/Node.

Here's what I do. The registry has a bunch of servers in the application (e.g. 20). I create a session with the registry and call Session::getAdmin(). Then I give a copy of IceGrid::AdminPrx and one of the server ID's to each of my client's threads (e.g. 20 threads).

I can reproduce this using my multi-threaded client and the Hello Server from the IceGrid simple example. I'm also using the registry/node configs from the same example.

Before I provide code and traces I'd like to ask if what I'm doing is supposed to work? Is there something strange because of the session? Does every client thread need its own session?

Linux, Ice 3.2.1

thanks for the free support,
alex

Comments

  • benoit
    benoit Rennes, France
    Hi Alex,

    This should work. Could you attach the IceGrid registry and node with the debugger and post the thread dumps?

    Cheers,
    Benoit.
  • Hi Benoit,

    in order to get debugging information I had to install Ice from source, so I decided that I may as well use 3.3b.

    but ... I can't reproduce the problem with 3.3! The same code seems to hang in 3.2.1 but not in 3.3b. I guess that's good news.

    the workaround in 3.2.1 seems to be to set the number of threads in my own "thread pool" to be strictly less than the number of threads available to any of the registry/node in the system. I'm not sure exactly which pool is the limiting factor, so I don't specify any SizeMax explicitly and only use 9 threads in my client.

    I'm happy to wait for the 3.3 upgrade or I can run more tests with 3.2.1 if you are curious to know what's going on.

    thanks, alex
  • benoit
    benoit Rennes, France
    Hi Alex,

    We changed the implementation of the Admin stopServer method in Ice 3.3 to forward the stop request to the IceGrid node using an AMI call rather than a synchronous call. This is the reason why it works now with 3.3.

    So with 3.2.1, to avoid this hang, you should configure more threads for the IceGrid.Registry.Client thread pool (default is a maximum of 10 threads). For example:
       IceGrid.Registry.Client.ThreadPool.Size=1
       IceGrid.Registry.Client.ThreadPool.SizeMax=100
    

    Cheers,
    Benoit.