All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <iwj@xenproject.org>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [OSSTEST PATCH 3/5] TCP fix: Do not wait for ownerdaemon to speak
Date: Mon, 28 Sep 2020 14:12:39 +0100	[thread overview]
Message-ID: <20200928131241.30278-4-iwj@xenproject.org> (raw)
In-Reply-To: <20200928131241.30278-1-iwj@xenproject.org>

From: Ian Jackson <ian.jackson@eu.citrix.com>

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tcl/JobDB-Executive.tcl | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tcl/JobDB-Executive.tcl b/tcl/JobDB-Executive.tcl
index 29c82821..4fe85696 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
-- 
2.20.1



  parent reply	other threads:[~2020-09-28 13:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28 13:12 [RESEND OSSTEST PATCH 0/5] Fix TCP problem Ian Jackson
2020-09-28 13:12 ` [OSSTEST PATCH 1/5] daemonlib: Provide a "noop" command Ian Jackson
2020-09-28 13:12 ` [OSSTEST PATCH 2/5] TCP fix: Do not wait for queuedaemon to speak Ian Jackson
2020-09-28 13:12 ` Ian Jackson [this message]
2020-09-28 13:12 ` [OSSTEST PATCH 4/5] TftiDiVersion: Update to latest installer for stretch Ian Jackson
2020-09-28 13:12 ` [OSSTEST PATCH 5/5] Update TftpDiVersion_buster Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200928131241.30278-4-iwj@xenproject.org \
    --to=iwj@xenproject.org \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.