diff mbox series

[OSSTEST,2/5] TCP fix: Do not wait for queuedaemon to speak

Message ID 20200928131241.30278-3-iwj@xenproject.org (mailing list archive)
State New, archived
Headers show
Series Fix TCP problem | expand

Commit Message

Ian Jackson Sept. 28, 2020, 1:12 p.m. UTC
From: Ian Jackson <ian.jackson@eu.citrix.com>

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 | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm
index 61a99bc3..80e70070 100644
--- a/Osstest/Executive.pm
+++ b/Osstest/Executive.pm
@@ -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;
 }