]> xenbits.xensource.com Git - xcp/xen-api.git/commit
CA-42914: Deal with unexpected closure of data socket caused by exception in block_de...
authorJonathan Davies <jonathan.davies@citrix.com>
Thu, 28 Oct 2010 16:00:59 +0000 (17:00 +0100)
committerJonathan Davies <jonathan.davies@citrix.com>
Thu, 28 Oct 2010 16:00:59 +0000 (17:00 +0100)
commitcf1ecbb7325fa699ae1e406ea778aa65956b4b08
tree713982debbe8ab3e80761b43560a78969dfeb8c4
parent1c32df9695a6b0633943181dd3af25a67492e30e
CA-42914: Deal with unexpected closure of data socket caused by exception in block_device_io

Previously, the closing of the data socket causes xapi's code that writes database to an fd to raise Sys_error("Connection reset by peer").

Instead, we can safely ignore the unexpected closing of the data socket and wait until we hear what happened over the control socket. Any exception that may be raised during transfer_data_from_sock_to_fd in block_device_io (that causes the data socket to be prematurely closed) gets caught in the exception handlers in action_writedb that call send_failure. So suppress all Sys_error("Connection reset by peer") exceptions that xapi may raise during the writing of the database to the fd because full details should be forthcoming on the control socket.

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
ocaml/database/block_device_io.ml
ocaml/database/redo_log.ml