From: Ian Jackson Date: Mon, 28 Sep 2020 11:43:30 +0000 (+0100) Subject: TCP fix: Do not wait for ownerdaemon to speak X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=253eab3e553a30ec9b17e9a76d99c65eeb51e709;p=osstest.git TCP fix: Do not wait for ownerdaemon to speak Signed-off-by: Ian Jackson --- diff --git a/tcl/JobDB-Executive.tcl b/tcl/JobDB-Executive.tcl index 29c8282..4fe8569 100644 --- a/tcl/JobDB-Executive.tcl +++ b/tcl/JobDB-Executive.tcl @@ -414,7 +414,20 @@ proc become-task {comment} { set ownerqueue [socket $c(OwnerDaemonHost) $c(OwnerDaemonPort)] fconfigure $ownerqueue -buffering line -translation lf + + # TCP connections can get into a weird state where the client + # thinks the connection is open but the server has no record + # of it. To avoid this, have the client speak without waiting + # for the server. We tolerate "unknown command" errors so + # that it is not necessary to restart the ownerdaemon since + # that is very disruptive. + # + # See A TCP "stuck" connection mystery" + # https://www.evanjones.ca/tcp-stuck-connection-mystery.html + puts $ownerqueue noop must-gets $ownerqueue {^OK ms-ownerdaemon\M} + must-gets $ownerqueue {^OK noop|^ERROR unknown command} + puts $ownerqueue create-task must-gets $ownerqueue {^OK created-task (\d+) (\w+ [\[\]:.0-9a-f]+)$} \ taskid refinfo