From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Asynchronous DNS Date: Sun, 28 Feb 2016 15:13:41 +1030 Message-ID: <87si0dwiki.fsf@gnus.org> References: <87lh71nriy.fsf@gnus.org> <8637t8opla.fsf@realize.ch> <871t8skg6c.fsf@gnus.org> <86y4b0n5q2.fsf@realize.ch> <87fux7gb7o.fsf@gnus.org> <83wpqjvd2f.fsf@gnu.org> <87zivfobn4.fsf@gnus.org> <86y4ao5g1c.fsf@realize.ch> <87r3ggdo9f.fsf@gnus.org> <86twlb5yl4.fsf@realize.ch> <83d1rzz1mu.fsf@gnu.org> <86egcc49qu.fsf@realize.ch> <87io1k41cg.fsf@gnus.org> <56C8A89C.4020909@cs.ucla.edu> <861t873zlj.fsf@realize.ch> <56C8CD9D.1020504@cs.ucla.edu> <86twl22w7b.fsf@realize.ch> <87povils9h.fsf@gnus.org> <86wppqv76g.fsf@realize.ch> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1456634675 3670 80.91.229.3 (28 Feb 2016 04:44:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Feb 2016 04:44:35 +0000 (UTC) Cc: Paul Eggert , YAMAMOTO Mitsuharu , emacs-devel@gnu.org To: Alain Schneble Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 28 05:44:24 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aZtDS-0008TV-Um for ged-emacs-devel@m.gmane.org; Sun, 28 Feb 2016 05:44:23 +0100 Original-Received: from localhost ([::1]:57444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZtDS-0003MK-8U for ged-emacs-devel@m.gmane.org; Sat, 27 Feb 2016 23:44:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZtDO-0003M5-Mr for emacs-devel@gnu.org; Sat, 27 Feb 2016 23:44:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZtDL-0007c1-H7 for emacs-devel@gnu.org; Sat, 27 Feb 2016 23:44:18 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:49155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZtDL-0007bs-Aw for emacs-devel@gnu.org; Sat, 27 Feb 2016 23:44:15 -0500 Original-Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aZtCt-0000fi-UC; Sun, 28 Feb 2016 05:43:48 +0100 In-Reply-To: <86wppqv76g.fsf@realize.ch> (Alain Schneble's message of "Sat, 27 Feb 2016 10:22:47 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aZtCt-0000fi-UC MailScanner-NULL-Check: 1457239428.88713@gKg+4KjbuXCEOfTr71YcMg X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:200742 Archived-At: Alain Schneble writes: > 1. Suspend the thread using gai_suspend, waiting for the DNS request to > complete. > > 2. Calling a "blocker" similar to wait_for_socket_fds, to wait for DNS > request completion in a loop. But this would need additional logic > in wait_reading_process_output, to not proceed with > connect_network_socket in case process deletion is pending. > > 3. Any other way of postponing freeaddrinfo. > > I'm not sure, but my gut feeling says that option #1 may be acceptable > in this situation. We might run into "suspend" only in corner cases, if > the process is being deleted while a request is still being processed. Yes, I agree. Suspending seems like the best solution here, but I can imagine unfortunate consequences when doing that. For instance, if Emacs is shutting down, and it just calls `delete-process' on everything (which it does, I think?), then Emacs exit would hang until getaddrinfo returns (which may take many seconds). (That is, if Emacs just has decided to resolve something in the background, for instance by erc deciding to reconnect or something.) Could we detect whether Emacs is shutting down, perhaps? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no