From patchwork Mon Sep 28 13:12:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11803815 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7EC22139A for ; Mon, 28 Sep 2020 13:14:04 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5C80A2074A for ; Mon, 28 Sep 2020 13:14:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C80A2074A Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=xenproject.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kMsxi-0004Gi-E8; Mon, 28 Sep 2020 13:13:02 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kMsxg-0004DB-R5 for xen-devel@lists.xenproject.org; Mon, 28 Sep 2020 13:13:00 +0000 X-Inumbo-ID: 625c183d-a0c0-400b-aced-525f919c6902 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 625c183d-a0c0-400b-aced-525f919c6902; Mon, 28 Sep 2020 13:12:46 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1kMsxR-0007vv-PR; Mon, 28 Sep 2020 14:12:46 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Cc: Ian Jackson Subject: [OSSTEST PATCH 3/5] TCP fix: Do not wait for ownerdaemon to speak Date: Mon, 28 Sep 2020 14:12:39 +0100 Message-Id: <20200928131241.30278-4-iwj@xenproject.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200928131241.30278-1-iwj@xenproject.org> References: <20200928131241.30278-1-iwj@xenproject.org> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Ian Jackson Signed-off-by: Ian Jackson --- 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