[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Spipe doesn't close when (established) connection times out (due to sleeping, network interruption, etc)



On 11/18/12 13:47, Blake Rainwater wrote:
> The client connects to the server notification daemon by using spipe,
> and then pipes the output of spipe to the monitor-sync function, which
> has an infinite read loop in it. When the server daemon is killed, the
> socket is closed and then the client side program closes out properly
> (since spipe closes), however when it is disconnected (wifi turned
> off, network cable unplugged, client put to sleep, etc) for a very
> long time (e.g. overnight), and then (the network) is connected again,
> the client side daemon does not receive updates anymore, but spipe
> remains as if it were still connected. With short disconnections
> (tested up to the order of minutes, however I suspect that it may be
> up to a few hours) the client receives any updates that occurred
> during the disconnection, and the notifications work properly.

It turns out that this was a bug in spiped -- when a connection was
reset, it failed to drop it (instead, it accidentally treated a
connection reset the same as a connection shutdown -- shutting down
the other end of the connection but not closing it).

This is fixed in spiped 1.3.0.

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid