From patchwork Sat Nov 24 13:48:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kirillov X-Patchwork-Id: 10696535 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1D431709 for ; Sat, 24 Nov 2018 13:48:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B117529E0A for ; Sat, 24 Nov 2018 13:48:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4C622A55A; Sat, 24 Nov 2018 13:48:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3ABAD29E0A for ; Sat, 24 Nov 2018 13:48:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726445AbeKYAhB (ORCPT ); Sat, 24 Nov 2018 19:37:01 -0500 Received: from p3plsmtpa07-04.prod.phx3.secureserver.net ([173.201.192.233]:56614 "EHLO p3plsmtpa07-04.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726419AbeKYAhB (ORCPT ); Sat, 24 Nov 2018 19:37:01 -0500 Received: from jessie.local ([212.149.203.197]) by :SMTPAUTH: with ESMTPSA id QYIOgBCcrpgijQYISgsj85; Sat, 24 Nov 2018 06:48:33 -0700 From: Max Kirillov To: Junio C Hamano , git@vger.kernel.org, Carlo Arenas Cc: Max Kirillov , peff@peff.net Subject: [PATCH] http-backend: enable cleaning up forked upload/receive-pack on exit Date: Sat, 24 Nov 2018 15:48:27 +0200 Message-Id: <20181124134827.13932-1-max@max630.net> X-Mailer: git-send-email 2.19.0.1202.g68e1e8f04e In-Reply-To: <20181124130337.GH5348@jessie.local> References: MIME-Version: 1.0 X-CMAE-Envelope: MS4wfOFdz6iW/lyceoaBfJDWUcjZ2DkmWycGy2PC0Q7S0Ga1sV4UzVIkdVE8fRlcYylSDBqdep4ItODv/aif1mJlYGf9eH0WJoueCFZzl1Y5z9j5IRbbTwXp qJ9Tz1AHEkOMdtSDkauJxVHaK5XrSP/76AmZ9dsMaReVRVrlWW9Jd4Vs/SQiNBuMEWYkiIjDH9ermyiR+rO+gFRSOjjkPIJZdGDg+EhHwIrQvdqxqV5DHQoc ut4T9LQPpLAAfEM5NgrbEO6X1T7YkzFobaIzSAEJrMw= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If http-backend dies because of errors, started upload-pack or receive-pack are not killed and waited, but rather stay running for somtime until they exits because of closed stdin. It may be undesirable in working environment, and it also causes occasional failure of t5562, because the processes keep opened act.err, and sometimes write there errors after next test started using the file. Fix by enabling cleaning of the command at http-backed exit. Reported-by: Carlo Arenas Helped-by: Carlo Arenas Signed-off-by: Max Kirillov --- This seems to fix the issue at NetBSD. I verified it manually with strace but could not catch the visible timing effect in tests at Linux. So no tests for it. the "t5562: do not reuse output files" patches are not needed then http-backend.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/http-backend.c b/http-backend.c index 9e894f197f..29e68e38b5 100644 --- a/http-backend.c +++ b/http-backend.c @@ -486,6 +486,8 @@ static void run_service(const char **argv, int buffer_input) if (buffer_input || gzipped_request || req_len >= 0) cld.in = -1; cld.git_cmd = 1; + cld.clean_on_exit = 1; + cld.wait_after_clean = 1; if (start_command(&cld)) exit(1);