atom feed32 messages in org.freebsd.freebsd-archclose() of active socket does not wor...
FromSent OnAttachments
Kostik BelousovDec 11, 2006 9:11 am 
Arne H. JuulDec 11, 2006 2:40 pm 
David XuDec 11, 2006 4:15 pm 
Arne H. JuulDec 11, 2006 4:50 pm 
David XuDec 11, 2006 5:05 pm 
Daniel EischenDec 11, 2006 5:08 pm 
Bruce EvansDec 11, 2006 9:54 pm 
Poul-Henning KampDec 11, 2006 10:43 pm 
Daniel EischenDec 12, 2006 5:21 am 
Kostik BelousovDec 12, 2006 5:59 am 
Daniel EischenDec 12, 2006 6:24 am 
Daniel EischenDec 12, 2006 6:35 am 
Kostik BelousovDec 12, 2006 6:38 am 
Daniel EischenDec 12, 2006 12:49 pm 
David XuDec 12, 2006 3:29 pm 
Bruce EvansDec 12, 2006 7:28 pm 
Julian ElischerDec 12, 2006 11:12 pm 
Bruce EvansDec 13, 2006 3:28 am 
David XuDec 13, 2006 4:10 am 
Daniel EischenDec 13, 2006 6:23 am 
Robert WatsonDec 20, 2006 8:22 am 
Daniel EischenDec 20, 2006 10:28 am 
David XuDec 20, 2006 4:19 pm 
Julian ElischerDec 21, 2006 5:02 am 
Robert WatsonDec 21, 2006 5:46 am 
Robert WatsonDec 21, 2006 7:21 am 
Daniel EischenDec 21, 2006 9:15 am 
John-Mark GurneyDec 21, 2006 6:17 pm 
David XuDec 21, 2006 6:42 pm 
Daniel EischenDec 21, 2006 7:35 pm 
John-Mark GurneyDec 21, 2006 8:07 pm 
Daniel EischenDec 21, 2006 8:16 pm 
Subject:close() of active socket does not work on FreeBSD 6
From:Daniel Eischen (deis@freebsd.org)
Date:Dec 21, 2006 8:16:27 pm
List:org.freebsd.freebsd-arch

On Thu, 21 Dec 2006, John-Mark Gurney wrote:

Daniel Eischen wrote this message on Thu, Dec 21, 2006 at 22:35 -0500:

On Thu, 21 Dec 2006, John-Mark Gurney wrote:

I used to expect something similar w/ an kqueue based event driven web server, and found that I had bugs due to assuming that I could close it whenever I want... What happens if you close the fd between the time select returns and you process it? What happens if the fd gets closed, and another thread (or an earlier fd that accepts connections) reuses that fd? And then youre state machine isn't read to get an event since it isn't suppose to get one yet...

The kernel isn't buggy wrt closing a fd when another thread is using it, it's the program that's buggy...

I agree also, but hanging without return isn't very detectable.

It's a lot more detectable than working 99% more of the time and failing when things get correupted due to a race.. :)

I dunno, I think returning an appropriate error on the actual call(s) that are problematic is easier to detect than trying to figure out just what is causing the hang, corruption, whatever. Perhaps I mean "debug" instead of "detect".

The best thing to do is to tell the programmer that he is doing something stupid, and returning with an error is the way that it is typically done. Solaris seems to have jumped through

As long as it's EDOOFUS... I don't see any other error that would be approriate...

EBADF. That's what Solaris returns and makes more sense to me.

some hoops to achieve this behavior, so I doubt it is without merit. OTOH, I'm not going to argue that it is one of the more important things we should be worried about ;-)

As long as it doesn't cost much more to do it... Hanging is just as good of an indication as returning an error... And I'd say it's better as it forces the buggy software to be fixed as opposed to simply ignoring the error which is likely what the programmer will do...

Yes, unfortunately, ignoring the error would probably happen a lot.