GNU bug report logs - #32452
26.1; gnutls_try_handshake maxes out cpu retrying when server is a bit busy

Previous Next

Package: emacs;

Reported by: Noam Postavsky <npostavs <at> gmail.com>

Date: Thu, 16 Aug 2018 12:14:01 UTC

Severity: minor

Tags: moreinfo

Found in version 26.1

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Noam Postavsky <npostavs <at> gmail.com>
To: 32452 <at> debbugs.gnu.org
Subject: bug#32452: 26.1; gnutls_try_handshake maxes out cpu retrying when server is a bit busy
Date: Thu, 16 Aug 2018 08:13:40 -0400
Severity: minor

Recently the debbugs.gnu.org server is slow to respond.  I notice this
both when opening bug reports in Firefox, and from Emacs.  However,
Emacs uses 100% cpu while waiting for the server.  I added a message
call in gnutls_try_handshake (see patch below), and got "gnutls
non-fatal: Resource temporarily unavailable, try again. [190088 times]"
in *Messages*.  This was from doing M-x gnus-read-ephemeral-bug-group,
it took 5 or 10 seconds to (eventually successfully) complete.

We should have some kind of delay to avoid sending so many useless
retries.

--- i/src/gnutls.c
+++ w/src/gnutls.c
@@ -65,6 +65,7 @@ your option) any later version.
 
 static bool gnutls_global_initialized;
 
+static char const * emacs_gnutls_strerror (int err);
 static void gnutls_log_function (int, const char *);
 static void gnutls_log_function2 (int, const char *, const char *);
 # ifdef HAVE_GNUTLS3
@@ -558,7 +559,9 @@ gnutls_try_handshake (struct Lisp_Process *proc)
     }
   while (ret < 0
 	 && gnutls_error_is_fatal (ret) == 0
-	 && ! non_blocking);
+	 && ! non_blocking
+         && (message ("gnutls non-fatal: %s", emacs_gnutls_strerror (ret)),
+             true));
 
   proc->gnutls_initstage = GNUTLS_STAGE_HANDSHAKE_TRIED;




This bug report was last modified 3 years and 117 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.