From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id 82CD13858408 for ; Wed, 7 Feb 2024 16:01:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 82CD13858408 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 82CD13858408 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707321683; cv=none; b=dzKB/nqtWTwUb7QsCEMQV5LA/IV9fVAL/JD2Vl6L4oy1NkfZMHGbysZJIHzUcaMgIQraJVsIq4rx3l+KCNSbZxWPNZwEPi0cxNf9zuBbXejirFN94usYoGk5k6shwVlZwseougD4BII74AcBMLcOkGJ8nO19rC0pGGQfix4mcMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707321683; c=relaxed/simple; bh=WZc20SxMIkvqS10CbWK4JHCiZzwitmHHID4SGD8nzQA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=pwmpXu77cVpdkjzCkAN5D56AWMhOExMNgsEPsMaYLKMJxomB1no5n8FD/p3EBqbJ1Dgs+Nvk806KU0E2qU5zv4XNHzeHvSGBvhQN4xON2TVR38fvi2vKtlkGexys1e33pLWAuK39f5Bs+rkwEBxE44f4nvC3EdotsRKtJXkfHR4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6010a.ext.cloudfilter.net ([10.0.30.248]) by cmsmtp with ESMTPS id XebirLI5d80oiXkMSr2kv2; Wed, 07 Feb 2024 16:01:20 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id XkMSrde8sGPGSXkMSrkkLX; Wed, 07 Feb 2024 16:01:20 +0000 X-Authority-Analysis: v=2.4 cv=C+9KyhP+ c=1 sm=1 tr=0 ts=65c3a950 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=k7vzHIieQBIA:10 a=Qbun_eYptAEA:10 a=GOmiVmNSmbBaG0w2zNIA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=L059ddv4kmilSv22EIgbbYYO05u0A3XYvW4zwuBRbr8=; b=Ma5zikhOIVVhxOfZZzZdkDN0L5 w8vw9eALiqO28dtFU8UlPY0CGn9qnMiaMTclkpDS6CFmD91P1Zd2/HR9kTTNTjTa7l19m3WKqWuki YNUCViWfbpJSLUM7Bq2Alz07T; Received: from 97-122-68-157.hlrn.qwest.net ([97.122.68.157]:53830 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rXkMR-002gly-3C; Wed, 07 Feb 2024 09:01:20 -0700 From: Tom Tromey To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [RFC 1/3] [gdb/dap] Fix exit race References: <20240207090224.27521-1-tdevries@suse.de> <20240207090224.27521-2-tdevries@suse.de> X-Attribution: Tom Date: Wed, 07 Feb 2024 09:01:19 -0700 In-Reply-To: <20240207090224.27521-2-tdevries@suse.de> (Tom de Vries's message of "Wed, 7 Feb 2024 10:02:22 +0100") Message-ID: <875xz0clgw.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.68.157 X-Source-L: No X-Exim-ID: 1rXkMR-002gly-3C X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-68-157.hlrn.qwest.net (murgatroyd) [97.122.68.157]:53830 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfIXBPozBPFryLGLr/Rjy/ntB85VBhbPRriFB8UwDB20/v2HsJEMFl1QY7w+08cJG6xntbHgqHeQtY1ahdDtul1/s/yJKfeDYCYMx+OJmvomjl45D9H64 b2p+Sa4pBK7LlWGLbsPcPbC7CB6qbwqpeUn+gyOxyHGdk1C2qmb+3FYA8yHN+2UQYMU6388pqwSsqcTNzwJauwdRY6RF7vvIhyc= X-Spam-Status: No, score=-3016.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Tom" == Tom de Vries writes: Tom> Then I tried to simply remove send_gdb("quit"), and that worked as well, and Tom> caused no regressions. So, either this is the easiest way to address this, or Tom> we need to add a test-case that regresses when we remove it. Right now main_loop does: # Got the terminate request. This is handled by the # JSON-writing thread, so that we can ensure that all # responses are flushed to the client before exiting. self.write_queue.put(None) Like the comment says, this approach tries to ensure that all responses have been flushed to the client before quitting. However, I suppose this approach does not really work, because main_loop then proceeds to return. One way to fix this would be to have start_json_writer return the thread object, and then have main_loop join the thread to terminate after writing the None. This would mean making this particular thread non-daemon though. In this setup, removing the "quit" here is the right thing to do. Tom