[omniORB] omniORB4 connect backlog

Norrie Quinn norrie.quinn@tumbleweed.com
Fri Sep 27 20:26:01 2002


We are seeing random TRANSIENT exceptions when multiple client worker
threads attempt to establish a connection to a server simultaneously.  With
a backlog length of 5, the servers pending connection queue gets swamped and
rejects some connections.  We are using threadPerConnectionPolicy=1.

This may not be considered a bug in omniORB, and there may be good reason
why the backlog is set to 5, but we found it was occuring frequently on a
Windows 2000 4CPU machine with omniORB4 under load.  Previous versions of
omniORB had the same behaviour.

The simple patches below (tested on Windows 2000 and Solaris) extend the
backlog to the maximum for the platform.

Regards
Norrie

Index: tcpEndpoint.cc
===================================================================
RCS file:
/cvsroot/omniorb/omni/src/lib/omniORB/orbcore/tcp/Attic/tcpEndpoint.cc,v
retrieving revision 1.1.2.15
diff -r1.1.2.15 tcpEndpoint.cc
221c221
<   if (listen(pd_socket,5) == RC_SOCKET_ERROR) {
---
>   if (listen(pd_socket, SOMAXCONN) == RC_SOCKET_ERROR) {


Index: sslEndpoint.cc
===================================================================
RCS file:
/cvsroot/omniorb/omni/src/lib/omniORB/orbcore/ssl/Attic/sslEndpoint.cc,v
retrieving revision 1.1.2.16
diff -r1.1.2.16 sslEndpoint.cc
222c222
<   if (listen(pd_socket,5) == RC_SOCKET_ERROR) {
---
>   if (listen(pd_socket, SOMAXCONN) == RC_SOCKET_ERROR) {


Index: unixEndpoint.cc
===================================================================
RCS file:
/cvsroot/omniorb/omni/src/lib/omniORB/orbcore/unix/Attic/unixEndpoint.cc,v
retrieving revision 1.1.2.9
diff -r1.1.2.9 unixEndpoint.cc
157c157
<   if (listen(pd_socket,5) == RC_SOCKET_ERROR) {
---
>   if (listen(pd_socket, SOMAXCONN) == RC_SOCKET_ERROR) {