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: gnutls infloop possibly fixed Date: Sun, 12 Feb 2012 20:47:14 +0100 Message-ID: <87fwefj0l9.fsf@gnus.org> References: <87hayx8feo.fsf@gnus.org> <87ehu0lqc7.fsf@lifelogs.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1329076060 23974 80.91.229.3 (12 Feb 2012 19:47:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 12 Feb 2012 19:47:40 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 12 20:47:39 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RwfOZ-0003Bm-Nf for ged-emacs-devel@m.gmane.org; Sun, 12 Feb 2012 20:47:35 +0100 Original-Received: from localhost ([::1]:56781 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwfOZ-0005i1-75 for ged-emacs-devel@m.gmane.org; Sun, 12 Feb 2012 14:47:35 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:34165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwfOV-0005hu-N0 for emacs-devel@gnu.org; Sun, 12 Feb 2012 14:47:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RwfOU-0004aS-38 for emacs-devel@gnu.org; Sun, 12 Feb 2012 14:47:31 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:41363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwfOT-0004aA-T5 for emacs-devel@gnu.org; Sun, 12 Feb 2012 14:47:30 -0500 Original-Received: from 93-41-188-50.ip82.fastwebnet.it ([93.41.188.50] helo=rusty) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1RwfOG-0003Ze-AK for emacs-devel@gnu.org; Sun, 12 Feb 2012 20:47:16 +0100 In-Reply-To: <87ehu0lqc7.fsf@lifelogs.com> (Ted Zlatanov's message of "Sat, 11 Feb 2012 21:48:08 -0500") User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux) X-MailScanner-ID: 1RwfOG-0003Ze-AK MailScanner-NULL-Check: 1329680836.62854@qjAJGqEBo1GKgATGjriGIg 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:148522 Archived-At: Ted Zlatanov writes: > Thanks! I have just one question: can we, instead of aborting on > EAGAIN, retry a few times? My suggestion is below. That would make sense, I guess. I have no idea whether EAGAIN is a common situation to be in when doing writes on a functioning network, though. That is, if EAGAIN "never" happens when the network is up, then adding the loop doesn't help any. But it doesn't hurt, either, so... > Maybe we could wait a millisecond, too. Or is all that handled at the > Emacs process loop level? The Emacs process loop will eventually try to write the stuff out again, but how long it takes can be pretty random. If Emacs is idle, it retries about once a second, I think? But if we've just said `process-send-string' and then is in an `accept-process-output' loop (which would be the common case), then it'll probably be retried sooner? Perhaps? Hey, I can just test that now by taking down the network and hitting `g'... let's see... Ok: [pid 5621] 20:45:22 sendto(13, "p`q\214\\\37\354\20QD\215\272$\t\241\347\273\343\316\322\247", 21, 0, NULL, 0) = -1 EAGAIN (Resource temporarily unavailable) [pid 5621] 20:45:22 sendto(13, "p`q\214\\\37\354\20QD\215\272$\t\241\347\273\343\316\322\247", 21, 0, NULL, 0) = -1 EAGAIN (Resource temporarily unavailable) [pid 5621] 20:45:22 sendto(13, "p`q\214\\\37\354\20QD\215\272$\t\241\347\273\343\316\322\247", 21, 0, NULL, 0) = -1 EAGAIN (Resource temporarily unavailable) (etc) It seems to retry the GnuTLS sendto about 20 times a second in the `g' test. I think that's probably more than good enough, and adding an extra loop there isn't necessary. -- (domestic pets only, the antidote for overdose, milk.) http://lars.ingebrigtsen.no * Sent from my Rome