Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 79F37429E26 for ; Mon, 12 Dec 2011 08:16:28 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r8A64cVxXgNy for ; Mon, 12 Dec 2011 08:16:28 -0800 (PST) Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU [18.7.68.34]) by olra.theworths.org (Postfix) with ESMTP id 0E1DB429E25 for ; Mon, 12 Dec 2011 08:16:27 -0800 (PST) X-AuditID: 12074422-b7ff56d00000092f-4c-4ee628db8324 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP id 3A.DC.02351.BD826EE4; Mon, 12 Dec 2011 11:16:27 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id pBCGGQw3028095; Mon, 12 Dec 2011 11:16:27 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pBCGGPXM003914 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Mon, 12 Dec 2011 11:16:26 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1Ra8Zk-0005mV-9W; Mon, 12 Dec 2011 11:18:00 -0500 Date: Mon, 12 Dec 2011 11:18:00 -0500 From: Austin Clements To: Tomi Ollila Subject: Re: [PATCH] test/smtp-dummy: add --background option for backgrounding after listen(2) Message-ID: <20111212161800.GO2760@mit.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42IRYrdT0b2t8czPoGeeqsX1mzOZLd6snMfq wORx+OtCFo9nq24xBzBFcdmkpOZklqUW6dslcGVM+f+HteA/e8WvC5/YGhg3s3UxcnJICJhI LG87CmWLSVy4tx7I5uIQEtjHKNF1aCGUs4FR4uXTZ6wQzkkmibPvZ0A5SxglJn2/ygTSzyKg KvF422dWEJtNQENi2/7ljCC2iICKxIO29WBxZgFpiW+/m8HqhQUSJc6efAxm8wpoS9yeswCs XgjI3npkJzNEXFDi5MwnLBC9WhI3/r0EqucAm7P8HwdImFNAR+LR+X1gY0SBVk05uY1tAqPQ LCTds5B0z0LoXsDIvIpRNiW3Sjc3MTOnODVZtzg5MS8vtUjXVC83s0QvNaV0EyM4sF2UdjD+ PKh0iFGAg1GJh3en/1M/IdbEsuLK3EOMkhxMSqK8FurP/IT4kvJTKjMSizPii0pzUosPMUpw MCuJ8DZzA+V4UxIrq1KL8mFS0hwsSuK8dbse+gkJpCeWpGanphakFsFkZTg4lCR4jYERLCRY lJqeWpGWmVOCkGbi4AQZzgM0XAOkhre4IDG3ODMdIn+KUVFKnLcAJCEAksgozYPrhSWeV4zi QK8I86aBVPEAkxZc9yugwUxAg+NSnoAMLklESEk1MPpfu7k+R+5l1qMLXyc/6TCd9Wi56c1j UoWlNzoXLVyp4OO05FW2b5XOl1MfM4Lt7rdOFgrRfn+/boPeC0mp4B12z5ZbX7myQsqiNu1p 6c/Extkr1s1ZV1kR6HTg/DHtDXM+7D60bJHCS0GZbQ/2uazNc5y6a+VerqiKrJDp23d9/+DS Pv3tjPISJZbijERDLeai4kQA1y2xGxcDAAA= Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Dec 2011 16:16:28 -0000 Quoth Tomi Ollila on Dec 12 at 4:57 pm: > To avoid the possibility that smtp-dummy doesn't have chance to listen > its bound socket until something tries to send message to it this > option can be used for caller to wait until socket is already listening > for a connection. > --- > > When test_require_external_prereq() is changed to use associative > array to check whether prereq is missing bash script is often > so fast that it already waiting for smtp-dummy to exit until > socket is listening. i.e sending QUIT to 127.0.0.1:25025 fails > since there is no listener. (fork(2) & execve(2) count goes to zero > in test_require_external_prereq (from 3 fork()s, 2 execve()s). Perhaps smtp-dummy should always work this way? There's a race even in the working case, since Emacs could try to connect to the smtp-dummy before it's listening (perhaps Emacs retries in that case, but I couldn't find any code to do so). How are you going to wait on the dummy, since you don't know its PID any more?