[omniORB] Server hangs when client crashes

Sai-Lai Lo S.Lo@orl.co.uk
02 Oct 1998 14:20:10 +0100


I want to understand why this is happening.

Firstly, I assume you are using HP's C++ compiler and not egcs/gcc. If not
I suspect it is most likely that the compiler is generating wrong code. So
far I have not received positive confirmation that egcs/gcc on HPUX is usable
with omniORB2 (which can be seen as a non-trival multithreaded C++ testsuite).

Secondly, one factor you have to consider is the fact that HPUX-10.x is
using dce-threads. There is no kernel thread support. Therefore all the
blocking I/Os are done via a wrapper within the pthread library to give the
illusion that each thread can block on a socket independently. Correct me
if I'm wrong- I think the wrapper would only come into play if you have
included pthread.h in all your {.c/.cc} files that contain blocking I/O
calls. This is how dce-threads on Ultrix used to work. Now if your main
thread calls into a library independent of omniORB2 and if that library
does a blocking I/O call and if that library was not compiled with
pthread.h, your whole process would be blocked until that call returns! I
wonder if this situation applies to your application.

Finally, your system may not have all the OS patches related to dce-threads
installed. Someone from HP once admitted to me that the pthread
implementation in HPUX 10-x is poor. He promises that HPUX 11 is much
better. Let wait and see. 

Sai-Lai


>>>>> bjornw  writes:

> (I'm running the latest omniorb-snapshot on HPUX-10.20, with dce-threads)

> When running two or more clients against one server, and one of the client
> crashes, the server blocks.

> The server implements one simple method like this:
> query_result *
> ServerFactory::Query(int id)
> {
>  // create a result
>  return result;
> }

> When one of the client stops, it seems like the server blocks in the
> return-statement while trying to send to the client that recently
> crashed.

> Does this mean that the server does not create a new thread per
> client-connection?  Or, better how can I prevent this from happening.

-- 
Dr. Sai-Lai Lo                          |       Research Scientist
                                        |
E-mail:         S.Lo@orl.co.uk          |       Olivetti & Oracle Research Lab
                                        |       24a Trumpington Street
Tel:            +44 223 343000          |       Cambridge CB2 1QA
Fax:            +44 223 313542          |       ENGLAND