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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Noam Postavsky <npostavs@HIDDEN>; dated Thu, 16 Aug 2018 12:14:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 32452 <at> debbugs.gnu.org:


Received: (at 32452) by debbugs.gnu.org; 24 Sep 2019 05:39:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 24 01:39:15 2019
Received: from localhost ([127.0.0.1]:37442 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iCdXe-0004T1-VG
	for submit <at> debbugs.gnu.org; Tue, 24 Sep 2019 01:39:15 -0400
Received: from quimby.gnus.org ([80.91.231.51]:55784)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1iCdXd-0004St-8W
 for 32452 <at> debbugs.gnu.org; Tue, 24 Sep 2019 01:39:13 -0400
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie)
 by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.89) (envelope-from <larsi@HIDDEN>)
 id 1iCdXZ-0001en-6O; Tue, 24 Sep 2019 07:39:11 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Noam Postavsky <npostavs@HIDDEN>
Subject: Re: bug#32452: 26.1; gnutls_try_handshake maxes out cpu retrying
 when server is a bit busy
References: <87wosqwlu3.fsf@HIDDEN> <83d0uiig3j.fsf@HIDDEN>
 <CAM-tV-9pezP6U-zT__Uw=jt-djexEnEnpowUA4sLD4VCfi_DFg@HIDDEN>
 <83zhxmgqrh.fsf@HIDDEN> <87r2ixx0t6.fsf@HIDDEN>
 <83pnyhh6ta.fsf@HIDDEN> <87o9e1w6kf.fsf@HIDDEN>
 <83d0uhgoxw.fsf@HIDDEN> <87ftzcwso7.fsf@HIDDEN>
Date: Tue, 24 Sep 2019 07:39:08 +0200
In-Reply-To: <87ftzcwso7.fsf@HIDDEN> (Noam Postavsky's message of "Fri, 17
 Aug 2018 18:10:32 -0400")
Message-ID: <87h85245j7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Noam Postavsky <npostavs@HIDDEN> writes: > + enum {
 MAX_DELAY_NS
 = 100 * 1000 * 1000 }; // Max 100ms delay. > + struct timespec delay = {
 0, 1000 }; > do > { > ret = gnutls_handshake (state); > @@ -558,7 +560,9 @@
 gnutls_try_handshake (struc [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 32452
Cc: Eli Zaretskii <eliz@HIDDEN>, 32452 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Noam Postavsky <npostavs@HIDDEN> writes:

> +  enum { MAX_DELAY_NS = 100 * 1000 * 1000 }; // Max 100ms delay.
> +  struct timespec delay = { 0, 1000 };
>    do
>      {
>        ret = gnutls_handshake (state);
> @@ -558,7 +560,9 @@ gnutls_try_handshake (struct Lisp_Process *proc)
>      }
>    while (ret < 0
>  	 && gnutls_error_is_fatal (ret) == 0
> -	 && ! non_blocking);
> +	 && ! non_blocking
> +         && (nanosleep (&delay, NULL),
> +             delay.tv_nsec = min (delay.tv_nsec * 2, MAX_DELAY_NS)));

This code has changed somewhat since the proposed patch:

  while ((ret = gnutls_handshake (state)) < 0)
    {
      do
	ret = gnutls_handshake (state);
      while (ret == GNUTLS_E_INTERRUPTED);

      if (0 <= ret || emacs_gnutls_handle_error (state, ret) == 0
	  || non_blocking)
	break;
      maybe_quit ();
    }

But perhaps adding some sleep here would be a good idea, anyway.  On the
other hand, 100ms seems way too long -- that's a noticeable slow-down in
network set-up.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32452; Package emacs. Full text available.

Message received at 32452 <at> debbugs.gnu.org:


Received: (at 32452) by debbugs.gnu.org; 21 Aug 2018 02:42:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 20 22:42:19 2018
Received: from localhost ([127.0.0.1]:56079 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1frwcc-0005SA-UT
	for submit <at> debbugs.gnu.org; Mon, 20 Aug 2018 22:42:19 -0400
Received: from eggs.gnu.org ([208.118.235.92]:59829)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1frwcb-0005Rx-7p
 for 32452 <at> debbugs.gnu.org; Mon, 20 Aug 2018 22:42:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1frwcS-0007fB-RX
 for 32452 <at> debbugs.gnu.org; Mon, 20 Aug 2018 22:42:11 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49794)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1frwcS-0007f5-Of; Mon, 20 Aug 2018 22:42:08 -0400
Received: from [176.228.60.248] (port=3489 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1frwcS-0005Me-CL; Mon, 20 Aug 2018 22:42:08 -0400
Date: Tue, 21 Aug 2018 05:42:05 +0300
Message-Id: <83va84cuf6.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Noam Postavsky <npostavs@HIDDEN>
In-reply-to: <874lfownf9.fsf@HIDDEN> (message from Noam Postavsky on Mon,
 20 Aug 2018 20:52:58 -0400)
Subject: Re: bug#32452: 26.1;
 gnutls_try_handshake maxes out cpu retrying when server is a bit busy
References: <87wosqwlu3.fsf@HIDDEN> <83d0uiig3j.fsf@HIDDEN>
 <CAM-tV-9pezP6U-zT__Uw=jt-djexEnEnpowUA4sLD4VCfi_DFg@HIDDEN>
 <83zhxmgqrh.fsf@HIDDEN> <87r2ixx0t6.fsf@HIDDEN>
 <83pnyhh6ta.fsf@HIDDEN> <87o9e1w6kf.fsf@HIDDEN>
 <83d0uhgoxw.fsf@HIDDEN> <87ftzcwso7.fsf@HIDDEN>
 <83pnygfajo.fsf@HIDDEN> <874lfownf9.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 32452
Cc: 32452 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Noam Postavsky <npostavs@HIDDEN>
> Cc: 32452 <at> debbugs.gnu.org
> Date: Mon, 20 Aug 2018 20:52:58 -0400
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> nanosleep isn't portable though right?
> >
> > We could use usleep instead, it's part of Posix, AFAIK.  And MinGW has
> > it as well, AFAICT.  Sorry I didn't mention it in the first place.
> 
> My usleep(3) man page says it's obsolete:

Then I guess use nanosleep if it's available and usleep if it isn't?

Alternatively, we could make nanosleep fopr Windows using usleep, and
use nanosleep from Gnulib if platforms other than Windows don't have
it.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32452; Package emacs. Full text available.

Message received at 32452 <at> debbugs.gnu.org:


Received: (at 32452) by debbugs.gnu.org; 21 Aug 2018 00:53:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 20 20:53:07 2018
Received: from localhost ([127.0.0.1]:56051 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fruuw-0000c8-Pp
	for submit <at> debbugs.gnu.org; Mon, 20 Aug 2018 20:53:06 -0400
Received: from mail-io0-f180.google.com ([209.85.223.180]:34131)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1fruuv-0000bf-L6
 for 32452 <at> debbugs.gnu.org; Mon, 20 Aug 2018 20:53:05 -0400
Received: by mail-io0-f180.google.com with SMTP id c22-v6so7994370iob.1
 for <32452 <at> debbugs.gnu.org>; Mon, 20 Aug 2018 17:53:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=FcZkqsya1Yry0SfUgW7ouP+lL+L3vP6eUikI1jKBZbs=;
 b=KhyHXdgy7OngaL+KuiRt5FckiuMCS6VN2TDJTfzTmWtdWrKojYkpv6fXlXOQLooWy1
 vtz6vlrJPMqsQyNH3Wfx7qL3umNqeKO2v7UCUGIypIx1Ik6mFv5n/LasbfWx5w53fD9J
 87bIz9xzz4UmtiBrCBfAuPn4ZWL5IWvDOKGfVNAB/3HCAnzwThIE+jVU5so39lXi0ULY
 nYgNeLvUWHV86EFhSt65euu6wFngZuvDHUa7t7fIH7a+3VheTU5yZCBBMxWf1UCOh/0C
 Bxivc64yv1vWMkbj1bl4zLu0PJ5ERLEYsu8+hc4CG3nLJhsGlFLItLH/Ku9Svip8GKMz
 zxDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=FcZkqsya1Yry0SfUgW7ouP+lL+L3vP6eUikI1jKBZbs=;
 b=j3NH9s2B00dfnVVUzrmbHdKp9BAY0fr4WgDpV2FsWdAYqq/ebhkVnHq3EDUG3MFmwA
 t0OuGiFR+3EUs/TFAJ0TI2f9T0JTtX1qTvvyDnlZxiNdxsSkVGyRYT4laAMdrTU1MkdA
 ha4GdUS1522Czq9zxk1/z/ee0g2tKNGN4T7BDkxGa3DWmylSDYPCmHJg+cKftVCaoQx2
 W3hAX97ZG+0Xwb2WNzmRlllONLeF98tjHrZLHPNmry5UFVk2MSNoPz7nCa8WvvlxZQsY
 64qtsCTqKoYu4VRwXcZTvPf4ktpyG95r3/11ABwTXf0cM2Qzs8VzGVBRDhrWrYp3cXs5
 /yyw==
X-Gm-Message-State: AOUpUlGN7l/uQKaiIt7hpgioxf4AC8N/DuD7azdHf5w5vTIMWB/TSGM1
 Ih//z6AEIomq740Ikcpjquab8TYy
X-Google-Smtp-Source: AA+uWPx2PUz4maCoIVz57s0IY9nDAq+Mzvl9263dWFk9wJ3G4O/6wDa6GQb63HpWgitpO78pharRbw==
X-Received: by 2002:a6b:3347:: with SMTP id
 z68-v6mr38843079ioz.231.1534812779927; 
 Mon, 20 Aug 2018 17:52:59 -0700 (PDT)
Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34])
 by smtp.googlemail.com with ESMTPSA id
 e140-v6sm627505itc.24.2018.08.20.17.52.59
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 20 Aug 2018 17:52:59 -0700 (PDT)
From: Noam Postavsky <npostavs@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#32452: 26.1;
 gnutls_try_handshake maxes out cpu retrying when server is a bit busy
References: <87wosqwlu3.fsf@HIDDEN> <83d0uiig3j.fsf@HIDDEN>
 <CAM-tV-9pezP6U-zT__Uw=jt-djexEnEnpowUA4sLD4VCfi_DFg@HIDDEN>
 <83zhxmgqrh.fsf@HIDDEN> <87r2ixx0t6.fsf@HIDDEN>
 <83pnyhh6ta.fsf@HIDDEN> <87o9e1w6kf.fsf@HIDDEN>
 <83d0uhgoxw.fsf@HIDDEN> <87ftzcwso7.fsf@HIDDEN>
 <83pnygfajo.fsf@HIDDEN>
Date: Mon, 20 Aug 2018 20:52:58 -0400
In-Reply-To: <83pnygfajo.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 18 Aug
 2018 09:34:03 +0300")
Message-ID: <874lfownf9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 32452
Cc: 32452 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> nanosleep isn't portable though right?
>
> We could use usleep instead, it's part of Posix, AFAIK.  And MinGW has
> it as well, AFAICT.  Sorry I didn't mention it in the first place.

My usleep(3) man page says it's obsolete:

    CONFORMING TO
           4.3BSD,  POSIX.1-2001.   POSIX.1-2001  declares  this  function  obsolete;  use  nanosleep(2)
           instead.  POSIX.1-2008 removes the specification of usleep().




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32452; Package emacs. Full text available.

Message received at 32452 <at> debbugs.gnu.org:


Received: (at 32452) by debbugs.gnu.org; 18 Aug 2018 06:34:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 18 02:34:24 2018
Received: from localhost ([127.0.0.1]:53901 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fquoa-0004EX-1x
	for submit <at> debbugs.gnu.org; Sat, 18 Aug 2018 02:34:24 -0400
Received: from eggs.gnu.org ([208.118.235.92]:42676)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1fquoY-0004Dx-4E
 for 32452 <at> debbugs.gnu.org; Sat, 18 Aug 2018 02:34:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1fquoO-0000iU-1B
 for 32452 <at> debbugs.gnu.org; Sat, 18 Aug 2018 02:34:16 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56657)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1fquoN-0000i4-N6; Sat, 18 Aug 2018 02:34:11 -0400
Received: from [176.228.60.248] (port=3852 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1fquoN-0006wg-2q; Sat, 18 Aug 2018 02:34:11 -0400
Date: Sat, 18 Aug 2018 09:34:03 +0300
Message-Id: <83pnygfajo.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Noam Postavsky <npostavs@HIDDEN>
In-reply-to: <87ftzcwso7.fsf@HIDDEN> (message from Noam Postavsky on Fri,
 17 Aug 2018 18:10:32 -0400)
Subject: Re: bug#32452: 26.1;
 gnutls_try_handshake maxes out cpu retrying when server is a bit busy
References: <87wosqwlu3.fsf@HIDDEN> <83d0uiig3j.fsf@HIDDEN>
 <CAM-tV-9pezP6U-zT__Uw=jt-djexEnEnpowUA4sLD4VCfi_DFg@HIDDEN>
 <83zhxmgqrh.fsf@HIDDEN> <87r2ixx0t6.fsf@HIDDEN>
 <83pnyhh6ta.fsf@HIDDEN> <87o9e1w6kf.fsf@HIDDEN>
 <83d0uhgoxw.fsf@HIDDEN> <87ftzcwso7.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 32452
Cc: 32452 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Noam Postavsky <npostavs@HIDDEN>
> Cc: 32452 <at> debbugs.gnu.org
> Date: Fri, 17 Aug 2018 18:10:32 -0400
> 
> The debbugs server seems back to normal speeds now, I'm getting ~200
> hits with it just like other servers.  The patch below brings it down to
> 15~20.

Good.

> nanosleep isn't portable though right?

We could use usleep instead, it's part of Posix, AFAIK.  And MinGW has
it as well, AFAICT.  Sorry I didn't mention it in the first place.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32452; Package emacs. Full text available.

Message received at 32452 <at> debbugs.gnu.org:


Received: (at 32452) by debbugs.gnu.org; 17 Aug 2018 22:10:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 17 18:10:42 2018
Received: from localhost ([127.0.0.1]:53813 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fqmx8-0004Xy-46
	for submit <at> debbugs.gnu.org; Fri, 17 Aug 2018 18:10:42 -0400
Received: from mail-it0-f68.google.com ([209.85.214.68]:36730)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1fqmx6-0004Xj-FB
 for 32452 <at> debbugs.gnu.org; Fri, 17 Aug 2018 18:10:40 -0400
Received: by mail-it0-f68.google.com with SMTP id p81-v6so13642360itp.1
 for <32452 <at> debbugs.gnu.org>; Fri, 17 Aug 2018 15:10:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=dCEHo0ZqbJ9iCpBZHX9cyIYMmDTcz01s6aMatyeh7/4=;
 b=S//aGmfdNZv1KRF6Sn1kqVF9USHo85ruUiH2ngX+lKCotDDP352e3Eg9A3cTIaO22N
 4niLZLfMgTjzDyDPHMSOoNuBIPZUf4xrgZmhPZ0jDPI2qpBhwxY39H5JPHi/K+1qQx1n
 SXzP9r9G6zhfHSBCnydjuU2x78fEPPNm0CdVxNzo8gdFuw310v9ljuisarAi+D6VYEJA
 lVKPjx0yFeudgWZv+jU4bqvQF8KoNP6yFLvvfbtfbNUt+emn1x/3ChbblSzZXRnRfSJN
 MjvdrnJoH2OIxeYs7UWqSuJn2UNAoo9r0quGOKMjdeuV2Nbox4nsU6pXt2Cez4OFHPvB
 l5nA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=dCEHo0ZqbJ9iCpBZHX9cyIYMmDTcz01s6aMatyeh7/4=;
 b=izSuJuYqK/kEVtgoW40G5252Z1aexv7s045I62+E3i/sSoCxDUxu4mUemyO5B/akNy
 zJQCdZw6OP6FP/AgmqgWRbeUtb6Uhf1buIyDmJPDNq+T4SIjmHD7HHJlqpk3pta/+Txo
 vYxEBN8/H2XMnm3l9rSznh6oasbCsWxTK2ahuBNhUozEugE00DZWHh6HkO1Ruzo3EN9o
 VTJvwwv5FtWRXO0X8GQqD0/VzzqjUiqrBymLtSZ1lUj1dMoR+mHjql66cG9imZftvf1F
 zk78gNtZRvn7Z24snbjWPt9bd/t5BbDwokI0UqXIupMWa4i5XNEy5GA+8laYjcHYjTYn
 NKUg==
X-Gm-Message-State: AOUpUlHj9LW2wkYQ3CuhWPrMd+5CZP38vWdKjP40BVydXtF7SMQd1mnB
 6NI4A7Sa+ntrVu+aI1bh8OaifkWp
X-Google-Smtp-Source: AA+uWPwalDXnnjnqdomMeJjuIz58W36rr68vQClADG85e5fhbShKFSQuwU8I2k/QI9CmYwzVjastvQ==
X-Received: by 2002:a24:9197:: with SMTP id
 i145-v6mr5488565ite.39.1534543834552; 
 Fri, 17 Aug 2018 15:10:34 -0700 (PDT)
Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34])
 by smtp.googlemail.com with ESMTPSA id
 h71-v6sm2447213ith.9.2018.08.17.15.10.33
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Fri, 17 Aug 2018 15:10:33 -0700 (PDT)
From: Noam Postavsky <npostavs@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#32452: 26.1;
 gnutls_try_handshake maxes out cpu retrying when server is a bit busy
References: <87wosqwlu3.fsf@HIDDEN> <83d0uiig3j.fsf@HIDDEN>
 <CAM-tV-9pezP6U-zT__Uw=jt-djexEnEnpowUA4sLD4VCfi_DFg@HIDDEN>
 <83zhxmgqrh.fsf@HIDDEN> <87r2ixx0t6.fsf@HIDDEN>
 <83pnyhh6ta.fsf@HIDDEN> <87o9e1w6kf.fsf@HIDDEN>
 <83d0uhgoxw.fsf@HIDDEN>
Date: Fri, 17 Aug 2018 18:10:32 -0400
In-Reply-To: <83d0uhgoxw.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 17 Aug
 2018 15:25:31 +0300")
Message-ID: <87ftzcwso7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 32452
Cc: 32452 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> In which case it's fine, we just need to do something in the loop to
> yield the CPU, like some nanosleep, perhaps?  And maybe enlarge the
> sleep period as time goes on?
>
> debbugs is terribly slow in a browser as well, right now.  But
> hundreds of attempts sounds excessive to me.

The debbugs server seems back to normal speeds now, I'm getting ~200
hits with it just like other servers.  The patch below brings it down to
15~20.  nanosleep isn't portable though right?  Not sure what to put
instead, it seems existing wait functions in Emacs are all tied up with
threads and processes, so I don't know if it's safe to call them here.

--- i/src/gnutls.c
+++ w/src/gnutls.c
@@ -550,6 +550,8 @@ gnutls_try_handshake (struct Lisp_Process *proc)
   if (non_blocking)
     proc->gnutls_p = true;
 
+  enum { MAX_DELAY_NS = 100 * 1000 * 1000 }; // Max 100ms delay.
+  struct timespec delay = { 0, 1000 };
   do
     {
       ret = gnutls_handshake (state);
@@ -558,7 +560,9 @@ gnutls_try_handshake (struct Lisp_Process *proc)
     }
   while (ret < 0
 	 && gnutls_error_is_fatal (ret) == 0
-	 && ! non_blocking);
+	 && ! non_blocking
+         && (nanosleep (&delay, NULL),
+             delay.tv_nsec = min (delay.tv_nsec * 2, MAX_DELAY_NS)));
 
   proc->gnutls_initstage = GNUTLS_STAGE_HANDSHAKE_TRIED;





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32452; Package emacs. Full text available.

Message received at 32452 <at> debbugs.gnu.org:


Received: (at 32452) by debbugs.gnu.org; 17 Aug 2018 12:26:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 17 08:26:03 2018
Received: from localhost ([127.0.0.1]:53319 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fqdpK-0007bl-TP
	for submit <at> debbugs.gnu.org; Fri, 17 Aug 2018 08:26:03 -0400
Received: from eggs.gnu.org ([208.118.235.92]:42869)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1fqdpI-0007bH-Ri
 for 32452 <at> debbugs.gnu.org; Fri, 17 Aug 2018 08:26:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1fqdp5-0007yx-IU
 for 32452 <at> debbugs.gnu.org; Fri, 17 Aug 2018 08:25:53 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38309)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1fqdp0-0007vY-Cq; Fri, 17 Aug 2018 08:25:44 -0400
Received: from [176.228.60.248] (port=2749 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1fqdoz-0005zS-L5; Fri, 17 Aug 2018 08:25:42 -0400
Date: Fri, 17 Aug 2018 15:25:31 +0300
Message-Id: <83d0uhgoxw.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Noam Postavsky <npostavs@HIDDEN>
In-reply-to: <87o9e1w6kf.fsf@HIDDEN> (message from Noam Postavsky on Fri,
 17 Aug 2018 07:55:44 -0400)
Subject: Re: bug#32452: 26.1;
 gnutls_try_handshake maxes out cpu retrying when server is a bit busy
References: <87wosqwlu3.fsf@HIDDEN> <83d0uiig3j.fsf@HIDDEN>
 <CAM-tV-9pezP6U-zT__Uw=jt-djexEnEnpowUA4sLD4VCfi_DFg@HIDDEN>
 <83zhxmgqrh.fsf@HIDDEN> <87r2ixx0t6.fsf@HIDDEN>
 <83pnyhh6ta.fsf@HIDDEN> <87o9e1w6kf.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 32452
Cc: 32452 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Noam Postavsky <npostavs@HIDDEN>
> Cc: 32452 <at> debbugs.gnu.org
> Date: Fri, 17 Aug 2018 07:55:44 -0400
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > OK, so do you understand the sequence of the events well enough to
> > describe what happens, and explain why we get so many EAGAIN errors?
> > I'm not yet sure this is bug, maybe it's just how things are in this
> > case (modulo exerting less CPU load, something that we certainly
> > should try).
> 
> I haven't really traced things through properly, but my current
> understanding/guess is that we're using non-blocking sockets even though
> we actually want blocking behaviour.  So to get the blocking behaviour
> we just spin in a loop.

In which case it's fine, we just need to do something in the loop to
yield the CPU, like some nanosleep, perhaps?  And maybe enlarge the
sleep period as time goes on?

> > Also, does this happen with every server, or just with some?
> 
> debbugs.gnu.org seems to be the most extreme case (at the moment), with
> other servers I see only about a hundred "Resource temporarily
> unavailable" messages (I'm noticing this now because I switched on
> gnutls-log-level, but it's not enough to cause a noticable CPU spike).

debbugs is terribly slow in a browser as well, right now.  But
hundreds of attempts sounds excessive to me.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32452; Package emacs. Full text available.

Message received at 32452 <at> debbugs.gnu.org:


Received: (at 32452) by debbugs.gnu.org; 17 Aug 2018 11:55:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 17 07:55:52 2018
Received: from localhost ([127.0.0.1]:53297 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fqdM8-0006nZ-Kp
	for submit <at> debbugs.gnu.org; Fri, 17 Aug 2018 07:55:52 -0400
Received: from mail-it0-f44.google.com ([209.85.214.44]:50448)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1fqdM7-0006nO-Mr
 for 32452 <at> debbugs.gnu.org; Fri, 17 Aug 2018 07:55:51 -0400
Received: by mail-it0-f44.google.com with SMTP id j81-v6so10901640ite.0
 for <32452 <at> debbugs.gnu.org>; Fri, 17 Aug 2018 04:55:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=KrxWAnMjEDfcLP1V7Mk8J4VifeUkE86nt69vff3h6tw=;
 b=jJiYREgCzVPX/JlXo22D5bUQntkYFmbmBDo+T0ZDdzpO7MMcgDehOpEELcUePYZnvV
 tCwDfKw5v0xLCM18kCtE5OfLQe4nh3bP0ibL8xUKPMT0Oo95cX7NpXtbc7+gJVS4qPjJ
 rnKpbeVktxDae/Ig5v3tUQoREYi3RUYy3S1sTW1syAoWAPJrDEpcZI7/DoT3hg1axEP/
 MmX6bKwyPfvGiDsVJK2b8N+IpXSWgREdSYnaysF8BvjUvThF3lx2kT5aclniuiBOjw9T
 DE1ZYv13E66Z7+7H1fHzbEBiltXoH5nfILmHPqcLACb0FCxRTrRp9lQ1lVF4V/2l68AX
 8JjA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=KrxWAnMjEDfcLP1V7Mk8J4VifeUkE86nt69vff3h6tw=;
 b=I5+jNTY42t/MyJydrZ+HoqXiTlD4/OIPiSCtesAhNcjzWbuV5Kq8XHfUXIdi2nPKhm
 dZ+2pq1Vfovrrmb58rJBcWcagpjUQKDze5x2SXLbo7ZzPPcDjK5ZeXOt5H+3U+7r+z7D
 RLIi8t8C5LoHzbRRYq4IfAJ4LdIjeJozM3bitpSHvXkbAoypj2L/AP2vTT3+PRVn5ug3
 rdooVfBPEX7u7x+EWde6chflpR7Gj78ooTrtHpzSWiQ8yevSaMFUQgIqxTXR2iKiYOGT
 4ao7gn48w/hIYiCYyiCYXQBNJYAfYAu9iwnD49zuzK+jnXwRA3d+K44xEOkAgVKUIyb+
 8Mew==
X-Gm-Message-State: AOUpUlHcqJnYzKbE1Nl3VsgRejYs96qaBXH/sodxRcxzrxY5oXM1JGTX
 E9aZrna63aqTF0Zy4KBJFW0F0eAE
X-Google-Smtp-Source: AA+uWPw4drku+Ah/5ZNywQEjMccYaRZD9GCJnQ6mOPjhvaPC8ztIeYf0Eh25noR3UYOViNNRrCGPBg==
X-Received: by 2002:a02:9d50:: with SMTP id
 m16-v6mr29961191jal.119.1534506945859; 
 Fri, 17 Aug 2018 04:55:45 -0700 (PDT)
Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34])
 by smtp.googlemail.com with ESMTPSA id
 v26-v6sm835272ioh.53.2018.08.17.04.55.45
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Fri, 17 Aug 2018 04:55:45 -0700 (PDT)
From: Noam Postavsky <npostavs@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#32452: 26.1;
 gnutls_try_handshake maxes out cpu retrying when server is a bit busy
References: <87wosqwlu3.fsf@HIDDEN> <83d0uiig3j.fsf@HIDDEN>
 <CAM-tV-9pezP6U-zT__Uw=jt-djexEnEnpowUA4sLD4VCfi_DFg@HIDDEN>
 <83zhxmgqrh.fsf@HIDDEN> <87r2ixx0t6.fsf@HIDDEN>
 <83pnyhh6ta.fsf@HIDDEN>
Date: Fri, 17 Aug 2018 07:55:44 -0400
In-Reply-To: <83pnyhh6ta.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 17 Aug
 2018 08:59:29 +0300")
Message-ID: <87o9e1w6kf.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 32452
Cc: 32452 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> OK, so do you understand the sequence of the events well enough to
> describe what happens, and explain why we get so many EAGAIN errors?
> I'm not yet sure this is bug, maybe it's just how things are in this
> case (modulo exerting less CPU load, something that we certainly
> should try).

I haven't really traced things through properly, but my current
understanding/guess is that we're using non-blocking sockets even though
we actually want blocking behaviour.  So to get the blocking behaviour
we just spin in a loop.

> Also, does this happen with every server, or just with some?

debbugs.gnu.org seems to be the most extreme case (at the moment), with
other servers I see only about a hundred "Resource temporarily
unavailable" messages (I'm noticing this now because I switched on
gnutls-log-level, but it's not enough to cause a noticable CPU spike).





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32452; Package emacs. Full text available.

Message received at 32452 <at> debbugs.gnu.org:


Received: (at 32452) by debbugs.gnu.org; 17 Aug 2018 05:59:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 17 01:59:52 2018
Received: from localhost ([127.0.0.1]:53182 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fqXnc-0001I6-ET
	for submit <at> debbugs.gnu.org; Fri, 17 Aug 2018 01:59:52 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50779)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1fqXnb-0001Hr-1X
 for 32452 <at> debbugs.gnu.org; Fri, 17 Aug 2018 01:59:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1fqXnR-0001v1-Ql
 for 32452 <at> debbugs.gnu.org; Fri, 17 Aug 2018 01:59:45 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49719)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1fqXnR-0001ux-N7; Fri, 17 Aug 2018 01:59:41 -0400
Received: from [176.228.60.248] (port=2176 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1fqXnR-0001ip-AG; Fri, 17 Aug 2018 01:59:41 -0400
Date: Fri, 17 Aug 2018 08:59:29 +0300
Message-Id: <83pnyhh6ta.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Noam Postavsky <npostavs@HIDDEN>
In-reply-to: <87r2ixx0t6.fsf@HIDDEN> (message from Noam Postavsky on Thu,
 16 Aug 2018 21:02:29 -0400)
Subject: Re: bug#32452: 26.1;
 gnutls_try_handshake maxes out cpu retrying when server is a bit busy
References: <87wosqwlu3.fsf@HIDDEN> <83d0uiig3j.fsf@HIDDEN>
 <CAM-tV-9pezP6U-zT__Uw=jt-djexEnEnpowUA4sLD4VCfi_DFg@HIDDEN>
 <83zhxmgqrh.fsf@HIDDEN> <87r2ixx0t6.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 32452
Cc: 32452 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Noam Postavsky <npostavs@HIDDEN>
> Cc: 32452 <at> debbugs.gnu.org
> Date: Thu, 16 Aug 2018 21:02:29 -0400
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > Compile with HAVE_GETADDRINFO_A undefined?  Although if :nowait is
> > nil, then I'm not sure such a compilation will change anything.  But I
> > think it's worth trying, as at least some of the related code doesn't
> > seem to be disabled by :nowait being nil, if my reading of the code is
> > correct.
> 
> No, it doesn't seem to make a difference (though the server is answering
> a bit faster at the moment, I'm only getting the 20~30k "Resource
> temporarily unavailable..." messages with both HAVE_GETADDRINFO_A
> defined and undefined).

OK, so do you understand the sequence of the events well enough to
describe what happens, and explain why we get so many EAGAIN errors?
I'm not yet sure this is bug, maybe it's just how things are in this
case (modulo exerting less CPU load, something that we certainly
should try).

Also, does this happen with every server, or just with some?

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32452; Package emacs. Full text available.

Message received at 32452 <at> debbugs.gnu.org:


Received: (at 32452) by debbugs.gnu.org; 17 Aug 2018 01:02:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 16 21:02:41 2018
Received: from localhost ([127.0.0.1]:53052 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fqTA1-0001y1-Bp
	for submit <at> debbugs.gnu.org; Thu, 16 Aug 2018 21:02:41 -0400
Received: from mail-it0-f47.google.com ([209.85.214.47]:35643)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1fqT9y-0001xZ-83
 for 32452 <at> debbugs.gnu.org; Thu, 16 Aug 2018 21:02:38 -0400
Received: by mail-it0-f47.google.com with SMTP id 139-v6so9648162itf.0
 for <32452 <at> debbugs.gnu.org>; Thu, 16 Aug 2018 18:02:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=T/vNGxOGY4vPHEcsadO8IsJ6TNFqLi8HTamTyxRcLAs=;
 b=rqX1xvPW0VzeO9i9rJz4qOI7c1laavseo9ftIJoEgZ7Ch7Qzfk6KCr2LUcqkSqHAFy
 6untOeyskm52A1F3sLFTUGUACRIqwLTYrfCCWtZIocf5CCUBwPad57ApoYzdranEgnEe
 IaoaEJU77ZWHzl830iMTU1X+Dn6Pb5hC2JaXdYS9ameFNVhT0xfMzAAzjPKZzrwJgzXM
 JAtyuWo62Ic5atR2wWOP+UTsB0bAf8gROkeZxJvmuxKg/3M6vxYyiKXURwmUH6RHrCXQ
 e+95OCXgh62pJiAhzkC1H14kkzcEk4wiEpfqyoYcZ8DcsXFdKzpYlj4By7vDObIHlndN
 c7mQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=T/vNGxOGY4vPHEcsadO8IsJ6TNFqLi8HTamTyxRcLAs=;
 b=AFH7ruZp4roXMZewX+gSTEnZS2eylJQ1q+dv2nVJewe3pjNDb3UN9bB1432bitCc0+
 iexQdelcuOg4CzObPM0c2SCleBDTReJ98UMayi4y2y+kI5xb4BdQPDuaVaBEbWLblAnt
 AzWWk9BS1ZbQqzhveIWD2o28vP3lFeNSG5JMkCFtBV+fF4O6zf/NcYUqRElkwDtpQ07U
 /OSuKG6h+L+08wn6eBVdvkytJy+3cA6fAvE2nnjHh9nZQBvH5qnPEiQq8WxPXfkbUKl+
 lfoAsapUco4pOn4Cpi4avaNNDZEtJ6SfNx+r5Uugjf6eJ6d+VOzmINiqkfVzLFM3IhHo
 sHBw==
X-Gm-Message-State: AOUpUlFHw/AwhT6sahr0/qjSfzmWWhkm51kxcMFGP6SyOjJ5hoyLmMBf
 cWDDlITG1QNEVmMgQ18JWTKfaFmm
X-Google-Smtp-Source: AA+uWPxQXD08ikI0PQV4/F0crXt44mlqyPJbG3C4Beu5wVvDXLhBC40lEGcdCveZ4Gca3Ii2uQe70w==
X-Received: by 2002:a24:75d0:: with SMTP id
 y199-v6mr23667463itc.4.1534467752620; 
 Thu, 16 Aug 2018 18:02:32 -0700 (PDT)
Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34])
 by smtp.googlemail.com with ESMTPSA id
 b11-v6sm482618ioc.16.2018.08.16.18.02.31
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Thu, 16 Aug 2018 18:02:31 -0700 (PDT)
From: Noam Postavsky <npostavs@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#32452: 26.1;
 gnutls_try_handshake maxes out cpu retrying when server is a bit busy
References: <87wosqwlu3.fsf@HIDDEN> <83d0uiig3j.fsf@HIDDEN>
 <CAM-tV-9pezP6U-zT__Uw=jt-djexEnEnpowUA4sLD4VCfi_DFg@HIDDEN>
 <83zhxmgqrh.fsf@HIDDEN>
Date: Thu, 16 Aug 2018 21:02:29 -0400
In-Reply-To: <83zhxmgqrh.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 16 Aug
 2018 20:33:54 +0300")
Message-ID: <87r2ixx0t6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 32452
Cc: 32452 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> Compile with HAVE_GETADDRINFO_A undefined?  Although if :nowait is
> nil, then I'm not sure such a compilation will change anything.  But I
> think it's worth trying, as at least some of the related code doesn't
> seem to be disabled by :nowait being nil, if my reading of the code is
> correct.

No, it doesn't seem to make a difference (though the server is answering
a bit faster at the moment, I'm only getting the 20~30k "Resource
temporarily unavailable..." messages with both HAVE_GETADDRINFO_A
defined and undefined).





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32452; Package emacs. Full text available.

Message received at 32452 <at> debbugs.gnu.org:


Received: (at 32452) by debbugs.gnu.org; 16 Aug 2018 17:34:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 16 13:34:21 2018
Received: from localhost ([127.0.0.1]:52791 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fqMA8-0006ze-Rd
	for submit <at> debbugs.gnu.org; Thu, 16 Aug 2018 13:34:21 -0400
Received: from eggs.gnu.org ([208.118.235.92]:57103)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1fqMA7-0006zP-Sl
 for 32452 <at> debbugs.gnu.org; Thu, 16 Aug 2018 13:34:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1fqM9y-0008VU-PH
 for 32452 <at> debbugs.gnu.org; Thu, 16 Aug 2018 13:34:14 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46983)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1fqM9y-0008VP-M7; Thu, 16 Aug 2018 13:34:10 -0400
Received: from [176.228.60.248] (port=2837 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1fqM9u-0000H5-NS; Thu, 16 Aug 2018 13:34:07 -0400
Date: Thu, 16 Aug 2018 20:33:54 +0300
Message-Id: <83zhxmgqrh.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Noam Postavsky <npostavs@HIDDEN>
In-reply-to: <CAM-tV-9pezP6U-zT__Uw=jt-djexEnEnpowUA4sLD4VCfi_DFg@HIDDEN>
 (message from Noam Postavsky on Thu, 16 Aug 2018 10:45:12 -0400)
Subject: Re: bug#32452: 26.1; gnutls_try_handshake maxes out cpu retrying when
 server is a bit busy
References: <87wosqwlu3.fsf@HIDDEN> <83d0uiig3j.fsf@HIDDEN>
 <CAM-tV-9pezP6U-zT__Uw=jt-djexEnEnpowUA4sLD4VCfi_DFg@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 32452
Cc: 32452 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Noam Postavsky <npostavs@HIDDEN>
> Date: Thu, 16 Aug 2018 10:45:12 -0400
> Cc: 32452 <at> debbugs.gnu.org
> 
> > Does anything change if you disable asynchronous DNS and connection
> > establishment?
> 
> Um, how should I do that?

Compile with HAVE_GETADDRINFO_A undefined?  Although if :nowait is
nil, then I'm not sure such a compilation will change anything.  But I
think it's worth trying, as at least some of the related code doesn't
seem to be disabled by :nowait being nil, if my reading of the code is
correct.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32452; Package emacs. Full text available.

Message received at 32452 <at> debbugs.gnu.org:


Received: (at 32452) by debbugs.gnu.org; 16 Aug 2018 14:45:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 16 10:45:20 2018
Received: from localhost ([127.0.0.1]:52674 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fqJWa-0006aH-Ln
	for submit <at> debbugs.gnu.org; Thu, 16 Aug 2018 10:45:20 -0400
Received: from mail-oi0-f42.google.com ([209.85.218.42]:37077)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1fqJWY-0006a6-SR
 for 32452 <at> debbugs.gnu.org; Thu, 16 Aug 2018 10:45:19 -0400
Received: by mail-oi0-f42.google.com with SMTP id j205-v6so8455329oib.4
 for <32452 <at> debbugs.gnu.org>; Thu, 16 Aug 2018 07:45:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=AkDZN4M1OYPlI6x1ULTJamviMKeRcpClYQREQfaeO70=;
 b=kewAbyRKc3LOCMejie/QC6L+T1m7RtpDcGdeoE692iw7AeAXg8TshhmLQCvFagp4UL
 nSsUBTAnJNWFsRNRkXpzKFTTp03xjzQJFw+rWNcl9g6zmO5krQp8yhPb0WB81NCEXNbD
 pH8lBRBqvkBhsIFeBjM8ILloM6zlHvP8P4Ai1a3wgFopZQNmXp1CioWoGjLlhdqPF0t5
 rLcZKzpsdhfV8WwaifhiP2JpGq1MWoPbBGsv6oaUppTX6lmxcyusgNPz6A7KQDn2C7Bs
 N7kq9BRosGZjz948fppwMx6IomyCD6S55ttC4vcIYwNlvYyiomKgkHAmGF0y51AEw+6H
 9R7A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=AkDZN4M1OYPlI6x1ULTJamviMKeRcpClYQREQfaeO70=;
 b=Uyv2Ym3s1fV2RI3wjgsA2F5jcVWsuD/Vzmyp4Ek5Qa2lm4VJr5cyeyy9lcQE1NWwVa
 JyidV/Mb2YWERn3d0SmHQmpwUMdIT8BU84b60OsyUa8o9m+84LOyz5XyHSR84bhkJxNS
 TvUk5A5+VadYj+PA68C6GRDB+VWiLfswnPD7oKI/3T1JmrIrtohJq+2wTbsnYgsvWbOS
 aX0XjEDfVrj+s/jhNYGX73QH5kMf4YVjau5sKlUih6f8giUCjLVbr470pCojPBXASdOP
 MGiIvFa8JpR43la3KN0OE3TaPBJK+UPRt95a+TW36ka1hIeErVI6uegFyY6fMQ1io/xD
 U2ig==
X-Gm-Message-State: AOUpUlEoXNYULaAotvRe3GSB5I2Ua/Lpyl3K74DrCEPvE9GxdXJrNZG5
 YZ4i3l86DMOP0uzgqVf2hMh8APSOQ0S64aXIWrM=
X-Google-Smtp-Source: AA+uWPylT8yuxTZKhgpytvXX7WGIUpzFXEO70WXKJ4NpVDSstjUqdmg4NaDJkXxu0EjXm70H15F4s4O8o5voGUMmrXw=
X-Received: by 2002:aca:c2c1:: with SMTP id
 s184-v6mr33624244oif.117.1534430713235; 
 Thu, 16 Aug 2018 07:45:13 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a9d:268d:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 07:45:12
 -0700 (PDT)
In-Reply-To: <83d0uiig3j.fsf@HIDDEN>
References: <87wosqwlu3.fsf@HIDDEN> <83d0uiig3j.fsf@HIDDEN>
From: Noam Postavsky <npostavs@HIDDEN>
Date: Thu, 16 Aug 2018 10:45:12 -0400
Message-ID: <CAM-tV-9pezP6U-zT__Uw=jt-djexEnEnpowUA4sLD4VCfi_DFg@HIDDEN>
Subject: Re: bug#32452: 26.1; gnutls_try_handshake maxes out cpu retrying when
 server is a bit busy
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/mixed; boundary="00000000000098637d05738e7d08"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 32452
Cc: 32452 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--00000000000098637d05738e7d08
Content-Type: text/plain; charset="UTF-8"

On 16 August 2018 at 09:41, Eli Zaretskii <eliz@HIDDEN> wrote:

> Does anything change if you disable asynchronous DNS and connection
> establishment?

Um, how should I do that? The :nowait argument to open-network-stream
is already nil, if that's what you meant (see attached backtrace).

--00000000000098637d05738e7d08
Content-Type: text/plain; charset="US-ASCII"; name="gnutls-boot-stacktrace.txt"
Content-Disposition: attachment; filename="gnutls-boot-stacktrace.txt"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_jkwnerbh0

RGVidWdnZXIgZW50ZXJlZC0tTGlzcCBlcnJvcjogKHF1aXQpCiAgZ251dGxzLWJvb3QoIzxwcm9j
ZXNzIGRlYmJ1Z3MuZ251Lm9yZz4gZ251dGxzLXg1MDlwa2kgKDpjb21wbGV0ZS1uZWdvdGlhdGlv
biB0IDpwcmlvcml0eSAiTk9STUFMOiVEVU1CRlciIDpob3N0bmFtZSAiZGViYnVncy5nbnUub3Jn
IiA6bG9nbGV2ZWwgMSA6bWluLXByaW1lLWJpdHMgMjU2IDp0cnVzdGZpbGVzIG5pbCA6Y3JsZmls
ZXMgbmlsIDprZXlsaXN0IG5pbCA6dmVyaWZ5LWZsYWdzIG5pbCA6dmVyaWZ5LWVycm9yIG5pbCA6
Y2FsbGJhY2tzIG5pbCkpCiAgZ251dGxzLW5lZ290aWF0ZSg6cHJvY2VzcyAjPHByb2Nlc3MgZGVi
YnVncy5nbnUub3JnPiA6dHlwZSBnbnV0bHMteDUwOXBraSA6aG9zdG5hbWUgImRlYmJ1Z3MuZ251
Lm9yZyIpCiAgb3Blbi1nbnV0bHMtc3RyZWFtKCJkZWJidWdzLmdudS5vcmciICM8YnVmZmVyICAq
dXJsLWh0dHAtdGVtcCo+ICJkZWJidWdzLmdudS5vcmciIDQ0MyBuaWwpCiAgbmV0d29yay1zdHJl
YW0tb3Blbi10bHMoImRlYmJ1Z3MuZ251Lm9yZyIgIzxidWZmZXIgICp1cmwtaHR0cC10ZW1wKj4g
ImRlYmJ1Z3MuZ251Lm9yZyIgNDQzICg6dHlwZSB0bHMgOm5vd2FpdCBuaWwpKQogIG9wZW4tbmV0
d29yay1zdHJlYW0oImRlYmJ1Z3MuZ251Lm9yZyIgIzxidWZmZXIgICp1cmwtaHR0cC10ZW1wKj4g
ImRlYmJ1Z3MuZ251Lm9yZyIgNDQzIDp0eXBlIHRscyA6bm93YWl0IG5pbCkKICB1cmwtb3Blbi1z
dHJlYW0oImRlYmJ1Z3MuZ251Lm9yZyIgIzxidWZmZXIgICp1cmwtaHR0cC10ZW1wKj4gImRlYmJ1
Z3MuZ251Lm9yZyIgNDQzIHRscykKICB1cmwtaHR0cC1maW5kLWZyZWUtY29ubmVjdGlvbigiZGVi
YnVncy5nbnUub3JnIiA0NDMgdGxzKQogIHVybC1odHRwKCNzKHVybCA6dHlwZSAiaHR0cHMiIDp1
c2VyIG5pbCA6cGFzc3dvcmQgbmlsIDpob3N0ICJkZWJidWdzLmdudS5vcmciIDpwb3J0c3BlYyBu
aWwgOmZpbGVuYW1lICIvY2dpL2J1Z3JlcG9ydC5jZ2k/YnVnPTMyNDQ0O21ib3htYWludD15ZXM7
bWJveHN0YXQ9eWVzIiA6dGFyZ2V0IG5pbCA6YXR0cmlidXRlcyBuaWwgOmZ1bGxuZXNzIHQgOnNp
bGVudCBuaWwgOnVzZS1jb29raWVzIHQgOmFzeW5jaHJvbm91cyBuaWwpICNmKGNvbXBpbGVkLWZ1
bmN0aW9uICgmcmVzdCBpZ25vcmVkKSAjPGJ5dGVjb2RlIDB4MTkxMDgyMT4pIChuaWwpIG5pbCB0
bHMpCiAgdXJsLWh0dHBzKCNzKHVybCA6dHlwZSAiaHR0cHMiIDp1c2VyIG5pbCA6cGFzc3dvcmQg
bmlsIDpob3N0ICJkZWJidWdzLmdudS5vcmciIDpwb3J0c3BlYyBuaWwgOmZpbGVuYW1lICIvY2dp
L2J1Z3JlcG9ydC5jZ2k/YnVnPTMyNDQ0O21ib3htYWludD15ZXM7bWJveHN0YXQ9eWVzIiA6dGFy
Z2V0IG5pbCA6YXR0cmlidXRlcyBuaWwgOmZ1bGxuZXNzIHQgOnNpbGVudCBuaWwgOnVzZS1jb29r
aWVzIHQgOmFzeW5jaHJvbm91cyBuaWwpICNmKGNvbXBpbGVkLWZ1bmN0aW9uICgmcmVzdCBpZ25v
cmVkKSAjPGJ5dGVjb2RlIDB4MTkxMDgyMT4pIChuaWwpKQogIHVybC1yZXRyaWV2ZS1pbnRlcm5h
bCgiaHR0cHM6Ly9kZWJidWdzLmdudS5vcmcvY2dpL2J1Z3JlcG9ydC5jZ2k/YnVnPTMyNDQ0O21i
b3htYWludD15ZXM7bWJveHN0YXQ9eWVzIiAjZihjb21waWxlZC1mdW5jdGlvbiAoJnJlc3QgaWdu
b3JlZCkgIzxieXRlY29kZSAweDE5MTA4MjE+KSAobmlsKSBuaWwgbmlsKQogIHVybC1yZXRyaWV2
ZSgiaHR0cHM6Ly9kZWJidWdzLmdudS5vcmcvY2dpL2J1Z3JlcG9ydC5jZ2k/YnVnPTMyNDQ0O21i
b3htYWludD15ZXM7bWJveHN0YXQ9eWVzIiAjZihjb21waWxlZC1mdW5jdGlvbiAoJnJlc3QgaWdu
b3JlZCkgIzxieXRlY29kZSAweDE5MTA4MjE+KSBuaWwgbmlsIG5pbCkKICB1cmwtcmV0cmlldmUt
c3luY2hyb25vdXNseSgiaHR0cHM6Ly9kZWJidWdzLmdudS5vcmcvY2dpL2J1Z3JlcG9ydC5jZ2k/
YnVnPTMyNDQ0O21ib3htYWludD15ZXM7bWJveHN0YXQ9eWVzIikKICB1cmwtaW5zZXJ0LWZpbGUt
Y29udGVudHMoImh0dHBzOi8vZGViYnVncy5nbnUub3JnL2NnaS9idWdyZXBvcnQuY2dpP2J1Zz0z
MjQ0NDttYm94bWFpbnQ9eWVzO21ib3hzdGF0PXllcyIgdCkKICBnbnVzLXJlYWQtZXBoZW1lcmFs
LWJ1Zy1ncm91cCgiMzI0NDQiICJodHRwczovL2RlYmJ1Z3MuZ251Lm9yZy9jZ2kvYnVncmVwb3J0
LmNnaT9idWc9JXM7bWJveG1haW50PXllczttYm94c3RhdD15ZXMiKQogIGZ1bmNhbGwtaW50ZXJh
Y3RpdmVseShnbnVzLXJlYWQtZXBoZW1lcmFsLWJ1Zy1ncm91cCAiMzI0NDQiICJodHRwczovL2Rl
YmJ1Z3MuZ251Lm9yZy9jZ2kvYnVncmVwb3J0LmNnaT9idWc9JXM7bWJveG1haW50PXllczttYm94
c3RhdD15ZXMiKQogIGNhbGwtaW50ZXJhY3RpdmVseShnbnVzLXJlYWQtZXBoZW1lcmFsLWJ1Zy1n
cm91cCByZWNvcmQgbmlsKQogIGNvbW1hbmQtZXhlY3V0ZShnbnVzLXJlYWQtZXBoZW1lcmFsLWJ1
Zy1ncm91cCByZWNvcmQpCiAgZXhlY3V0ZS1leHRlbmRlZC1jb21tYW5kKG5pbCAiZ251cy1yZWFk
LWVwaGVtZXJhbC1idWctZ3JvdXAiICJnbnVzLXJlYWQtZXBoZW1lcmFsLWIiKQogIGZ1bmNhbGwt
aW50ZXJhY3RpdmVseShleGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQgbmlsICJnbnVzLXJlYWQtZXBo
ZW1lcmFsLWJ1Zy1ncm91cCIgImdudXMtcmVhZC1lcGhlbWVyYWwtYiIpCiAgY2FsbC1pbnRlcmFj
dGl2ZWx5KGV4ZWN1dGUtZXh0ZW5kZWQtY29tbWFuZCBuaWwgbmlsKQogIGNvbW1hbmQtZXhlY3V0
ZShleGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQpCg==
--00000000000098637d05738e7d08--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32452; Package emacs. Full text available.

Message received at 32452 <at> debbugs.gnu.org:


Received: (at 32452) by debbugs.gnu.org; 16 Aug 2018 13:41:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 16 09:41:51 2018
Received: from localhost ([127.0.0.1]:52390 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fqIX9-0002UM-2K
	for submit <at> debbugs.gnu.org; Thu, 16 Aug 2018 09:41:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39842)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1fqIX7-0002TZ-DA
 for 32452 <at> debbugs.gnu.org; Thu, 16 Aug 2018 09:41:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1fqIWv-0005ux-NC
 for 32452 <at> debbugs.gnu.org; Thu, 16 Aug 2018 09:41:42 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41647)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1fqIWu-0005uX-Rn; Thu, 16 Aug 2018 09:41:37 -0400
Received: from [176.228.60.248] (port=3738 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1fqIWq-0004l9-UP; Thu, 16 Aug 2018 09:41:34 -0400
Date: Thu, 16 Aug 2018 16:41:20 +0300
Message-Id: <83d0uiig3j.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Noam Postavsky <npostavs@HIDDEN>
In-reply-to: <87wosqwlu3.fsf@HIDDEN> (message from Noam Postavsky on Thu,
 16 Aug 2018 08:13:40 -0400)
Subject: Re: bug#32452: 26.1;
 gnutls_try_handshake maxes out cpu retrying when server is a bit busy
References: <87wosqwlu3.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 32452
Cc: 32452 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Noam Postavsky <npostavs@HIDDEN>
> Date: Thu, 16 Aug 2018 08:13:40 -0400
> 
> 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.

Does anything change if you disable asynchronous DNS and connection
establishment?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32452; Package emacs. Full text available.

Message received at 32452 <at> debbugs.gnu.org:


Received: (at 32452) by debbugs.gnu.org; 16 Aug 2018 12:49:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 16 08:49:34 2018
Received: from localhost ([127.0.0.1]:52370 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fqHiY-0007vb-6f
	for submit <at> debbugs.gnu.org; Thu, 16 Aug 2018 08:49:34 -0400
Received: from mail-it0-f46.google.com ([209.85.214.46]:40699)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1fqHiW-0007v4-67
 for 32452 <at> debbugs.gnu.org; Thu, 16 Aug 2018 08:49:32 -0400
Received: by mail-it0-f46.google.com with SMTP id h23-v6so6441131ita.5
 for <32452 <at> debbugs.gnu.org>; Thu, 16 Aug 2018 05:49:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:subject:references:date:in-reply-to:message-id:user-agent
 :mime-version; bh=ZLrlQwVnBpVttNKMwXyW2eHDpgmORYTplkKY/x6Lu8s=;
 b=sHK724yxLOSPKSB7zYi4cvdoo4Jq+3So9nv3jv93GogZIt9WzVLvUQuDimioLzJS4C
 fEDmNmp6YIKYHpEhkixEQa2BopB521Oe1R6xyCDVe/RxcCzim2mPHDso193LIfmoUqJA
 fc4aH7n5RljZmka7sztRzdqEVdaa74BqbgTvCLU9FxHasYLw5xkaKCtPPvXNWFDLWpPo
 PuVaNAcuOkRpQlDzB379Yqi/zMmPSbs/Fy0znolabjDN8k5GiRwqm/1uCC95C7m5Kv2g
 kSoG1FBSMvLSeEQfb4KEHwWbusFRDkRkLVC7dRlnXhpLfbdyaXYvMBXZJlu5Og/5EEpx
 Zr9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=ZLrlQwVnBpVttNKMwXyW2eHDpgmORYTplkKY/x6Lu8s=;
 b=rHoab0QtrqJ9DtoSHbym83weUAgaBE/fu6m/DjsAHf4tsLN5BJnunD1abMqUS7sbts
 +i/HShU8SX7T4uR2ONXhjCEQoP9II+/89P4mux531WvTiBLtAGIzSYGIxGHgbx+7r/nk
 fLY8nFMRs9Imk3zwAdqvGVYwQUt0BtMIMLJKasmis5pSx7gG4yax5avzQvuD3GtdA1NH
 3VAiN970BJB9vE6hYAwqjDwdT+t4m6XX8HfbyrQKCj+2jQfHYDVtMVKHBFHpZQWNEkOy
 l+CsRIHkQL50U6naSLiMPGciKHr0Z6pS61l8bKG6eAtaCCg+4FIH63FBCi97XBk112TA
 zq5A==
X-Gm-Message-State: AOUpUlFnmXnOBTt+xkYey2HI11/R9Cic8Yl4t2UHjl6pK4KgI6TdF8vM
 Bj/F0cJfo6QZ+/8+2ZOAbKPQbkw/
X-Google-Smtp-Source: AA+uWPxveElj3zMnh2/FzsuV7tu8ey3SgnqBrmK3icLuSSfD8xqtDo2hVoZzaVy1TT4cwDkVEjzy1A==
X-Received: by 2002:a24:59c3:: with SMTP id
 p186-v6mr349475itb.92.1534423766416; 
 Thu, 16 Aug 2018 05:49:26 -0700 (PDT)
Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34])
 by smtp.googlemail.com with ESMTPSA id
 p130-v6sm409622itd.22.2018.08.16.05.49.25 for <32452 <at> debbugs.gnu.org>
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Thu, 16 Aug 2018 05:49:25 -0700 (PDT)
From: Noam Postavsky <npostavs@HIDDEN>
To: 32452 <at> debbugs.gnu.org
Subject: Re: bug#32452: 26.1;
 gnutls_try_handshake maxes out cpu retrying when server is a bit busy
References: <87wosqwlu3.fsf@HIDDEN>
Date: Thu, 16 Aug 2018 08:49:25 -0400
In-Reply-To: <87wosqwlu3.fsf@HIDDEN> (Noam Postavsky's message of "Thu, 16
 Aug 2018 08:13:40 -0400")
Message-ID: <87tvnuwk6i.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 32452
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Noam Postavsky <npostavs@HIDDEN> writes:

> I added a message call in gnutls_try_handshake (see patch below)

> +         && (message ("gnutls non-fatal: %s", emacs_gnutls_strerror (ret)),
> +             true));

Ah, this patch isn't needed, (setq gnutls-log-level 1) suffices:

gnutls.c: [1] (Emacs) non-fatal error: Resource temporarily unavailable, try again. [329434 times]




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32452; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 16 Aug 2018 12:13:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 16 08:13:55 2018
Received: from localhost ([127.0.0.1]:52351 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fqHA2-0006PY-TT
	for submit <at> debbugs.gnu.org; Thu, 16 Aug 2018 08:13:55 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45843)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1fqHA1-0006PD-Im
 for submit <at> debbugs.gnu.org; Thu, 16 Aug 2018 08:13:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <npostavs@HIDDEN>) id 1fqH9v-0006yg-Jl
 for submit <at> debbugs.gnu.org; Thu, 16 Aug 2018 08:13:48 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:52088)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <npostavs@HIDDEN>) id 1fqH9v-0006yb-EH
 for submit <at> debbugs.gnu.org; Thu, 16 Aug 2018 08:13:47 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38588)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <npostavs@HIDDEN>) id 1fqH9u-00050M-LM
 for bug-gnu-emacs@HIDDEN; Thu, 16 Aug 2018 08:13:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <npostavs@HIDDEN>) id 1fqH9r-0006xH-IE
 for bug-gnu-emacs@HIDDEN; Thu, 16 Aug 2018 08:13:46 -0400
Received: from mail-io0-x244.google.com ([2607:f8b0:4001:c06::244]:46930)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <npostavs@HIDDEN>) id 1fqH9r-0006x9-Dr
 for bug-gnu-emacs@HIDDEN; Thu, 16 Aug 2018 08:13:43 -0400
Received: by mail-io0-x244.google.com with SMTP id x5-v6so3627076iop.13
 for <bug-gnu-emacs@HIDDEN>; Thu, 16 Aug 2018 05:13:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:subject:date:message-id:mime-version;
 bh=kKppmrk+u5UrOAYrllRGaL1881oP9rLSrUWSPKN7OcM=;
 b=Ai9cEFDylzIRcAHnmNA/2nrEQRARhpOM2HObHOmVtzfoflE+vC/4jJcR8p0D2puaRD
 YCCd15mxmloi2SAVV+CUZTdZDIyiUfrBXSHXezq/E3d3TBoyfOuZih+KKIeE/OFNbxBe
 jAAvbW5b7Ocy2yT0p7d7u5ykWQzHT4+71cp+L7qSi2NSn5Cn97Eu3C1ZmfyCziOhAD8b
 yfoVhwFuMutHCept7V/9Mg6W4tN65QoJshAHZMw/m4+2FBR6aF1pA6ubkNCc4iIeZ9wE
 SL9Xru2pATV9TGKpX4NoTK0I/vTc9wS8UjzGbLpHk/1KbwkDrC/GoIIWCJYwoY/LiYfo
 enEg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version;
 bh=kKppmrk+u5UrOAYrllRGaL1881oP9rLSrUWSPKN7OcM=;
 b=hF1/C1iDoUo7JggVD3t8z8YBQwWy+t+sTKQnQDq1iM0W31zrElYYJKABhNwHjmoGfw
 1QeGW9MqxHgY/PhonNnEg9G1J/IC3Aa+rdLvapTxZuXN/mb0N0DMHqbFX0mPhlWaEoQd
 +3hw7u3MAHSjY5Xp9M31QhROlE2cbYrMCclJz9f/ubp55ChoIbgCldofcaCRiz88VzOV
 7e/Ee6IOUQ5Ezf6pwm3G94Gp9fjB6pKTQxE0grvowuXxBybt7SwFVn8dsBefpXiIremG
 0iCbrRPmxvKIWMYAGyNRlbMI+mw7bG15PeudSyIyMn/JFw87ziYC/UiXr2f0SgaaB1VV
 VWPw==
X-Gm-Message-State: AOUpUlGS1cto+2eacuf9WFK7cygH40wYF8ELJW0dnecdSw3jtR6jSBFH
 DIzV8wA8wt8EkBRKDd58Boe6Ebua
X-Google-Smtp-Source: AA+uWPyYMvwGslvwNeMtKyzue94S9CISYlmgkPpZcf1KYidEByFH+o1ZwvPMxQokVpknVTF0VSAmHQ==
X-Received: by 2002:a6b:8e07:: with SMTP id
 q7-v6mr25531231iod.169.1534421622498; 
 Thu, 16 Aug 2018 05:13:42 -0700 (PDT)
Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34])
 by smtp.googlemail.com with ESMTPSA id
 y90-v6sm419055ita.17.2018.08.16.05.13.40 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Thu, 16 Aug 2018 05:13:41 -0700 (PDT)
From: Noam Postavsky <npostavs@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 26.1;
 gnutls_try_handshake maxes out cpu retrying when server is a bit busy
Date: Thu, 16 Aug 2018 08:13:40 -0400
Message-ID: <87wosqwlu3.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

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;




Acknowledgement sent to Noam Postavsky <npostavs@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#32452; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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