Closed gperciva closed 8 months ago
Added a third fix (not as embarrassing).
References (but nothing looks relevant):
dispatch.c
https://github.com/Tarsnap/spiped/pull/53More importantly, we discussed shutdown()
receiving an ENOTCONN
back in https://github.com/Tarsnap/spiped/pull/350; the final opinion was:
Ok, I think this is ok; it looks to me like ENOTCONN should not (non-erroneously) happen here, even if we get RST.
If users start reporting ENOTCONN then we should probably treat it as a non-error.
We now have a report of ENOTCONN in #397 (although the cause was disguised by the problem in dispatch_shutdown()
), so this PR makes it a non-error.
(I can reproduce the ENOTCONN using postgresql; or with our test suite if I add a few sleep(1)
to our code. I haven't yet been able to reproduce ENOTCONN with test programs without modifying spiped code, but I think it's sufficiently clear what's happening.)
Oh, in case it's relevant for ENOTCONN: original report on Linux, but I reproduced it on FreeBSD 14.0-RELEASE-p3.
Two embarrassing mistakes here; the one in
dispatch_shutdown()
is particularly bad.These were uncovered during the investigation into #397, but they don't resolve whatever is happening in that issue. (I can reproduce the problem, but I'm still trying to figure out exactly what's happening there.)