develooper Front page | perl.perl5.porters | Postings from January 2001

Socket issues on Solaris 2.7.1 to 8

Thread Next
January 5, 2001 07:46
Socket issues on Solaris 2.7.1 to 8
Message ID:

We recently upgraded our development operating system from Solaris 2.5.1 to
Solaris 8 (also encountered on 2.7.1 and suspected to be a problem in 2.6).
While we did not expect any problems with our extensive Perl based
application, we have found that a Oracle database connection pooling server
has serious problems with socket connections on the new O/S. I have
attempted to research and develop a solution to this problem with no
solution in sight (other than a complete rewrite). I am hoping someone on
one of these lists has had a similar experience with the issue.

We are using straight TCP sockets using the Perl Socket module within the
server programs themselves. The server is a pre-forking parent/child server
with spawning of additional children as needed. The parent binds to a
master port on which the clients connect to find a free child. Each child
binds its own unique port which are collected by the parent and passed to
the clients on a connect. Connections to the parent either cause a
connection to a child which passes the data back to the client, or a spawn
of a new child as needed and connect to a child. The child is spawned using
a subroutine "spawnChild()" which takes a FileHandle object as a argument.
This filehandle is opened on a "-|" and the given process ID is assumed as
the pid of the child/parent relationship. The child is the spawned as a
separated processs using exec. This exec'd file is expected to bind to its
own port in the same 250 port range as the parent and passes back STDOUT to
the parent to notify it of its port location. However, it never
successfully binds its own port. The children report "Invalid argument"
from the socket bind. The ports which are occupied by the parent are found
as unavailable, while any other bind attempt returns "Invalid argument". I
believe this issue to be directly related to how the child forks using a "
-|" on a file handle rather than a generic fork, as I have seen some
indications that Solaris 2.6 does not play well with pipes.

I've begun remediating this server by completely rewriting the server and
connect mechanism using IO::Socket from scratch using a more standard
pre-fork model. I feel that the method that the current server runs is
quite kludgy, as I have not found an example of a pre-forking server that
behaves the same way. So far, the server development is progressing
adequately, however, I'd like to hear if there might be a way to minimally
change the current server process so that it will work on Solaris 2.8, as
this will save considerable effort to develop.

Thanks for any input,

Fred Hirsch
Senior Applications Developer
Market Information Systems
Toronto Stock Exchange

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About