Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 Jan 2006 14:47:29 +1030
From:      Bob Halley <Bob.Halley@nominum.com>
To:        freebsd-net@freebsd.org
Subject:   Unexpected EADDRINUSE
Message-ID:  <43BB4C59.3010800@nominum.com>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------060309070601060706020401
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Some of our regression tests fail randomly on FreeBSD with an unexpected 
EADDRINUSE error.  We didn't see this problem with 4.7, but we see it in 
4.11, 5.4, and 6.0.  We don't see this behavior on any of our other 
supported platforms.

We investigated the problem, and managed to come up with a way to 
reproduce the problem outside of our regression test suite.

To reproduce, first start the sink with "python sink.py".  Then run 
"python conn.py".  When we do this, we get EADDRINUSE after a short 
time.  Since we're binding the connecting socket to the wild port, this 
shouldn't happen.

If the

    s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

call is removed, the problem seems to go away.  The setting of 
SO_REUSEADDR is there because that's what some perhaps too-generic 
make-a-socket library code did; we realize it's not technically needed.  
Nevertheless, we don't see why it should fail either :).

I looked at the differences between 4.7 and later kernels but didn't 
manage to figure out how the changes caused this change in behavior.

Regards,

/Bob


--------------060309070601060706020401--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43BB4C59.3010800>