Re: [PATCH] test/smtp-dummy: add --background option for backgrounding after listen(2)
authorAustin Clements <amdragon@MIT.EDU>
Mon, 12 Dec 2011 16:18:00 +0000 (11:18 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:46 +0000 (09:40 -0800)
d2/7678feaa5a22ffb0398ac884af5b932a914c00 [new file with mode: 0644]

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