[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#32452: 26.1; gnutls_try_handshake maxes out cpu retrying when server

From: Noam Postavsky
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

--- 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;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]