]> xenbits.xensource.com Git - osstest.git/commitdiff
TCP fix: Do not wait for queuedaemon to speak
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 28 Sep 2020 11:41:13 +0000 (12:41 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Mon, 28 Sep 2020 12:13:09 +0000 (13:13 +0100)
This depends on the preceding daemonlib patch and an ms-queuedaemon
restart.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/Executive.pm

index 61a99bc3429e86d67ec7b3f8d1edc2882dce411b..80e7007019df47a9b16b5a7e4d8228faf881f797 100644 (file)
@@ -643,7 +643,16 @@ sub tcpconnect_queuedaemon () {
     my $qserv= tcpconnect($c{QueueDaemonHost}, $c{QueueDaemonPort});
     $qserv->autoflush(1);
 
+    # 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.
+    #
+    # See A TCP "stuck" connection mystery"
+    # https://www.evanjones.ca/tcp-stuck-connection-mystery.html
+    print $qserv "noop\n";
     $_= <$qserv>;  defined && m/^OK ms-queuedaemon\s/ or die "$_?";
+    $_= <$qserv>;  defined && m/^OK noop\s/ or die "$_?";
 
     return $qserv;
 }