Re: ORBACUS narrow hangs



ciaran.mchale@xxxxxxxx schrieb:
On 9 Feb, 08:51, Enrico Fichtner <enrico.ficht...@xxxxxxxx> wrote:
[clients pass a callback object reference to a register() operation on
a server. This normally seems to work okay, but under stress testing
client applications hang when calling _narrow() for an object in the
server]

It is difficult to debug programs remotely, but I suspect the problem
is deadlock between the clients and the server. It might happen as
follows (I'm taking guesses at some implementation details of your
system).

1. The server is multi-threaded and uses a thread pool of, say, size
10 to process incoming requests.

2. The register() operation is defined to be "oneway".

3. In the register() operation, the server invokes back on the
callback object, perhaps to test
that the callback object is contactable.

4. In the client, you do something like the following:

// basic CORBA initialization
orb = ...
rootPoa = ...
poaMgr = rootPoa->thePOAManager();

// create callback object and register it with server
callbackPoa = rootPoa->create_POA(...);
callbackSv = new CallbackSv(...);
callbackPoa->activate_object(callbackSv);
callbackObj = callbackSv->_this();
serveObj = ...
serverObj->register(callbackObj);

// more initialization that invokes more operations on the server
Server = T::_narrow(obj);

// go into an event loop so we can process callback invocations
POAMgr->activate();
orb->run();

If your architecture is similar to what I have described above then
the problem is that you are calling POAMgr->activate() AFTER serverObj-
register(). The CORBA runtime system in the client application will
not dispatch any incoming request until after you call POAMgr-
activate(); if the client application has a single-threaded
concurrency model then you may also have to call orb->run() for
incoming requests to be dispatched. The default state of a POA manager
is "holding" which means that incoming requests will be queued up. It
is only when you call POAMgr->activate() to put the POA manager into
the active state that the POA manager will allow incoming requests
(and any previously queued requests) to be dispatched.

Within the body of register(), the server is trying to invoke on the
client's callback object. The thread in the server trying to do this
will block until the client has invoked POAMgr->activate(). If the
register() operation was a normal (twoway) operation then you would
have gotten deadlock even with just one client trying to register with
the server. However, if, as I suspect, the register() operation is
"oneway" then deadlock is avoided if you have only a small number of
clients invoking register at the same time. This is because a few
threads, equal to the number of clients concurrently invoking
register(), in the server will be temporarily blocked but there will
still be another few threads in the server's thread pool to process
more incoming requests. However, if the number of clients concurrently
invoking register() on the server equals or exceeds the number of
threads in the server's thread pool, then the all the threads in the
server's thread pool will be blocked waiting for
the client to call POAMgr->activate(). Unfortunately, the clients
won't invoke that until after they have invoked some more operations
on the server (note: under some conditions, _narrow() might make a
remote call to the server). These invocations from clients to the
server cannot be dispatched by the server because the server's thread
pool is currently exhausted. The result is deadlock.

As I said near the start of this posting, I am taking a few guesses at
the architecture of your client-server application, so some of the
details in my explanation might not fit with your actual architecture,
but the symptoms you describe certainly do sound like deadlock.


Regards,
Ciaran.

Thanks for the clarification. Even though I couldn't explain it to myself in such a detailed way, I had that feeling that it might be caused by such a locking (patt) situation. However, strangely it doesn't change it's behavior if a spend a huge amount of threads to the pool (e.g. 100) but still run only about 20 clients. What I also noticed, if I start the clients "by hand", client for client, the blocking effect is way less then if I start them all at once through a script.

Best Regards,
Enrico
.



Relevant Pages

  • Re: A record dynamic DNS registration failing depending on DHCP
    ... for clients. ... so I can assume that your server is using the default root hints. ... are only being registered in the Reverse Lookup Zone. ... recieved their IP from another DHCP server register their name under the ...
    (microsoft.public.windows.server.dns)
  • RE: Users Cant Access Documents on Server
    ... Thanks for using the SBS newsgroup. ... As well as we know, if a workstation would not access network shares, then ... Leave the Default Gateway of the internal NIC blank of the server box. ... Clients That Require SMB Signing ...
    (microsoft.public.windows.server.sbs)
  • Re: Users Cant Access Documents on Server
    ... my computer to the network on the server. ... Connection Wizard none of the computers were listed. ... The Mac clients can not communicate with the server box. ... > Error Messages When You Open or Copy Network Files on Windows XP SP1 ...
    (microsoft.public.windows.server.sbs)
  • Re: [SLE] SMTP authentication
    ... So eventhough my local SMTP server dials up to the internet with a certain username and password, that same username and password would not be used as authentication between my local SMTP server and the ISP's one, should it be used as a relay? ... either defer all outgoing mails until you connect to the internet, then flush out all the mails in the queue. ... Your local server would use an external program like fetchmail to poll the mailserver of your ISP, download the mails and feed them to Postfix. ... The test does NOT say "All clients must be in mynetworks, ...
    (SuSE)
  • RE: VPN Clients Not Registering in AD DNS
    ... via VPN, the DNS records of the VPN clients are unable to be registered. ... Windows 2003 server? ... please let me know whether the clients get the IP ...
    (microsoft.public.windows.server.sbs)