axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bhushan Khanal <bhush...@wrq.com>
Subject RE: sockets lingering in unit tests on some platforms
Date Wed, 09 Jul 2003 17:02:00 GMT
Eric, 

You may be running into a problem commonly seen with C/C++ based servers
where the server sockets are in TIME_WAIT state. The sockets remains in that
state for the duration your Maximum Segment Lifetime (MSL varies from OS to
OS but I think its between 30 sec to 2 min). As you noticed, you will not be
able to bind or listen on that socket until its clears that state. BTW you
can check the socket state using netstat.

One way to get around this problem is by setting SO_REUSEADDR socket option
before you bind. I must say that I have not tried setting that option via
1.4 Java sockets. A lot of socket options were no-ops with 1.3 and earlier
VM's so you will have to try it out to see for sure.

Bhushan Khanal


-----Original Message-----
From: Eric.D.Friedman@wellsfargo.com [mailto:Eric.D.Friedman@wellsfargo.com]

Sent: Wednesday, July 09, 2003 9:23 AM
To: axis-dev@ws.apache.org
Subject: sockets lingering in unit tests on some platforms


I've noticed, when running the all-tests target on OS X with java 1.4.1,
that the sockets acquired (and supposedly released) for the purposes of
running the test.wsdl.multithread test case remains bound for a period of
time after the test is complete.  This causes the test suite to fail if you
run it again.

I spent some time hacking around with this last night and confess to being
stumped.  Here's what I've learned:

* It's definitely repeatable on OS X, but not always;
* It's seriously annoying;
* The problem occurs when the *client* tries to connect to the port in
question.  I added some debugging hooks and found that in some cases the
server code (SimpleAxisServer) was unable to bind to the socket.
* FWIW, I wrote some perl code to bind to the same socket and can reproduce
the problem there too -- the java process for the server is dead and gone,
but the socket's not released for a while after.
* I tried putting finalizers and try {} finally { /* really close everything
*/ } hooks in place, but no dice.
* You can't connect to the socket in question, but you also can't bind() it,
at least not always.

A log of the failed test is attached.  I'd appreciate knowing if anyone has
the same issue and would be grateful if someone with access to an OS X
machine could attempt to reproduce the problem.  You don't have to run all
of the tests -- just build axis from source and then execute "ant run" from
test/wsdl/multithread a few times in rapid succession - i.e ant run && ant
run && ant run or some such.

Thanks,
Eric

 <<run.log.txt>> 

Mime
View raw message