tools/xenstored: close socket connections on error
authorManuel Bouyer <bouyer@netbsd.org>
Wed, 3 Feb 2021 16:54:19 +0000 (17:54 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 4 Feb 2021 21:26:41 +0000 (21:26 +0000)
commitcd09c4929e9b70d77747ec187ea94731c8a06ab2
treeaab30fec748d51209ba0521b2a27e84eb58be8a9
parent4cc948020a58588d02413d92976ddd5233dd7cae
tools/xenstored: close socket connections on error

On error, don't keep socket connection in ignored state but close them.
When the remote end of a socket is closed, xenstored will flag it as an
error and switch the connection to ignored. But on some OSes (e.g.
NetBSD), poll(2) will return only POLLIN in this case, so sockets in ignored
state will stay open forever in xenstored (and it will loop with CPU 100%
busy).

Fixes: d2fa370d3ef9 ("tools/xenstore: Preserve bad client until they are destroyed")
Signed-off-by: Manuel Bouyer <bouyer@netbsd.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
tools/xenstore/xenstored_core.c