trent nelson ktctpxaonresolvecom interesting results committed patch test_socketpy r62152 expecting platforms except windows behave consistently ie pass given following import socket host 127001 sock socketsocketsocketaf_inet socketsock_stream sockbindhost 0 port sockgetsockname1 sockclose del sock sock1 socketsocketsocketaf_inet socketsock_stream sock1setsockoptsocketsol_socket socketso_reuseaddr 1 sock1bindhost port sock2 socketsocketsocketaf_inet socketsock_stream sock2setsockoptsocketsol_socket socketso_reuseaddr 1 sock2bindhost port second bind fail eaddrinuse least according so_reuseaddr so_reuseport socket options section chapter 75 stevens unix network programming volume 1 2nd ed tcp never able start multiple servers bind ip address port completely duplicate binding start one server binds 19869102 port 80 start another also binds 19869102 port 80 even set so_reuseaddr socket option second server results windows linux fail patched test none buildbots either platform encountered eaddrinuse socketerror second bind freebsd os x solaris tru64 pass test eaddrinuse raised second bind interesting ones passed bsd lineage ive reverted test r62156 planned real issue tests calling test_supportbind_socket assumption port returned method unbound fact current implementation cant guarantee def bind_portsock host preferred_port54321 port preferred_port 9907 10243 32999 0 try sockbindhost port port 0 port sockgetsockname1 return port except socketerror err msg err errnoeaddrinuse raise print sys__stderr__ warning failed listen port trying another port logic correct platforms windows linux havent looked networking test cases rely bind_port would think implementation would much reliable weve got returning unused port def bind_portsock host127001 args socketsocketsocketaf_inet socketsock_stream sbindhost 0 port sgetsockname1 sclose del sockbindhost port return port actually fwiw ran full regrtestpy trunk win32 change place tests still pass thoughts trent ________________________________________ lnmudhrdtmzckqvwlnmudhrdtmzckqvwlnmpythonorg lnmudhrdtmzckqvwlnmudhrdtmzckqvwlnmpythonorg behalf trent nelson ktctpxaonresolvecom sent 04 april 2008 1707 zvlllneumpythonorg subject pythondev socketsol_reuseaddr different semantics windows vs unix test_asynchat sometimes dying windows ive raised issue 2550 track problem ive also provided patch tracker test_socketpy reproduces issue anyone mind commit trunk id like observe platforms exhibit different behaviour via buildbots itll cause windows slaves fail test_socket though revert ive seen buildbots behave come actual patch windows fixes issue httpbugspythonorgissue2550 httpbugspythonorgfile9939test_socketpypatch trent ________________________________________ lnmudhrdtmzckqvwlnmudhrdtmzckqvwlnmpythonorg lnmudhrdtmzckqvwlnmudhrdtmzckqvwlnmpythonorg behalf trent nelson ktctpxaonresolvecom sent 03 april 2008 2240 zvlllneumpythonorg subject pythondev socketsol_reuseaddr different semantics windows vs unix test_asynchat sometimes dying windows started looking httpwwwpythonorgdevbuildbotallx8620w2k820trunkbuilds289steptest0 pertinent part test_asyncore test_asynchat command timed 1200 seconds without output sigkill failed kill process using fake rc1 program finished exit code 1 remotefailed failure instance traceback remote host traceback recent call last failure buildbotslavecommandstimeouterror sigkill failed kill process tried replicate buildbot order debug surprisingly could consistently running rtbat q uall test_asynchat log indicates python process becomes completely utterly wedged point cant even attach remote debugger step digging noticed ran following code two different python consoles eaddrinuse raised socketbind import socket socketsocketsocketaf_inet socketsock_stream ssetsockoptsocketsol_socket socketso_reuseaddr 1 sbind127001 54322 however take setsockopt line wallah second sbind raise eaddrinuse expected manifests really bizarre issue test_asynchat particualr subsequent sockaccept calls socket put python uber wedged state cant even ctrlc console need kill process directly leave office head home dont time look tonight wanted post others mull trent _______________________________________________ pythondev mailing list zvlllneumpythonorg httpmailpythonorgmailmanlistinfopythondev unsubscribe httpmailpythonorgmailmanoptionspythondevtnelson40onresolvecom _______________________________________________ pythondev mailing list zvlllneumpythonorg httpmailpythonorgmailmanlistinfopythondev unsubscribe httpmailpythonorgmailmanoptionspythondevtnelson40onresolvecom _______________________________________________ pythondev mailing list zvlllneumpythonorg httpmailpythonorgmailmanlistinfopythondev unsubscribe httpmailpythonorgmailmanoptionspythondevpythondev40tangomucom thu 07 aug 2008 010753 0700 pythondev socketsol_reuseaddr different semantics windows vs unix test_asynchat sometimes dying windows