Loading
jsonrpc: avoid calling poll() with a closed fd
If a connection is closed by the remote end, the JSON-RPC server could potentially call poll() on the pollfd containing the invalid file descriptor. Rework the logic so that the pollfd's fd field is set to a negative value so that poll() will ignore it until the connection is fully cleaned up by spdk_jsonrpc_server_conn_remove(). Also add handling for the potential error conditions returned by poll() so that if something does go wrong, the server doesn't get stuck polling a broken pollfd forever. Change-Id: Id02e3a230740c8ffd513888cb0564891b3aca069 Signed-off-by:Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/369285 Tested-by:
SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by:
Ben Walker <benjamin.walker@intel.com> Reviewed-by:
Jim Harris <james.r.harris@intel.com>