public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Cc: "Frank Ch. Eigler" <fche@redhat.com>, elfutils-devel@sourceware.org
Subject: Re: run-debuginfod-webapi-concurrency.sh
Date: Sun, 24 Apr 2022 12:22:50 +0200	[thread overview]
Message-ID: <YmUk+lhq1L5xVCEE@wildebeest.org> (raw)
In-Reply-To: <m3h76jfav2.fsf@fitzsim.org>

[-- Attachment #1: Type: text/plain, Size: 887 bytes --]

Hi,

On Sat, Apr 23, 2022 at 10:56:01PM -0400, Thomas Fitzsimmons wrote:
> "Frank Ch. Eigler" <fche@redhat.com> writes:
> >> But there is another way to prevent the "Server reached connection
> >> limit. Closing inbound connection." Pass the MHD_USE_ITC flag to
> >> MHD_start_daemon:
> >
> > Yeah, that looked promising to me too.  When I was last working on
> > this, that would have been my next thing to try.  I can't think of
> > a relevant downside, so let's try it.  (Add a #ifdef guard around
> > that macro, for older libmicrohttpd, like rhel7 methinks.)
> 
> On debian-ppc64, with and without the MHD_USE_ITC patch, I ran the test
> 20 times in a shell loop.  With MHD_USE_ITC, I got 20 passes, without
> it, 9 passes and 11 failures.
> 
> With the patch applied, a full "make check" succeeded.

Nice. Thanks for the feedback and testing. I pushed the attached.

Cheers,

Mark

[-- Attachment #2: 0001-debuginfod-Use-MHD_USE_ITC-in-MHD_start_daemon-flags.patch --]
[-- Type: text/x-diff, Size: 3290 bytes --]

From 3bcf887340fd47d0d8a3671cc45abe2989d1fd6c Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Sun, 24 Apr 2022 12:16:58 +0200
Subject: [PATCH] debuginfod: Use MHD_USE_ITC in MHD_start_daemon flags
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This prevents the "Server reached connection limit. Closing inbound
connection." issue we have been seeing in the
run-debuginfod-webapi-concurrency.sh testcase. From the manual:

    If the connection limit is reached, MHD’s behavior depends a bit
    on other options. If MHD_USE_ITC was given, MHD will stop
    accepting connections on the listen socket. This will cause the
    operating system to queue connections (up to the listen() limit)
    above the connection limit. Those connections will be held until
    MHD is done processing at least one of the active connections. If
    MHD_USE_ITC is not set, then MHD will continue to accept() and
    immediately close() these connections.

https://sourceware.org/bugzilla/show_bug.cgi?id=28708

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 debuginfod/ChangeLog                       | 4 ++++
 debuginfod/debuginfod.cxx                  | 3 +++
 tests/ChangeLog                            | 4 ++++
 tests/run-debuginfod-webapi-concurrency.sh | 4 +++-
 4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog
index d6f7b282..0f1bca6f 100644
--- a/debuginfod/ChangeLog
+++ b/debuginfod/ChangeLog
@@ -1,3 +1,7 @@
+2022-04-24  Mark Wielaard  <mark@klomp.org>
+
+	* debuginfod.cxx (main): Add MHD_USE_ITC to MHD_start_daemon flags.
+
 2022-04-13  Aaron Merey  <amerey@redhat.com>
 
 	* debuginfod-client.c (debuginfod_query_server):
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
index 9c0217f6..adca8208 100644
--- a/debuginfod/debuginfod.cxx
+++ b/debuginfod/debuginfod.cxx
@@ -3910,6 +3910,9 @@ main (int argc, char *argv[])
                                      | MHD_USE_EPOLL
 #endif
                                      | MHD_USE_DUAL_STACK
+#if MHD_VERSION >= 0x00095200
+                                     | MHD_USE_ITC
+#endif
                                      | MHD_USE_DEBUG, /* report errors to stderr */
                                      http_port,
                                      NULL, NULL, /* default accept policy */
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 2286f53f..44b8df88 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2022-04-24  Mark Wielaard  <mark@klomp.org>
+
+	* run-debuginfod-webapi-concurrency.sh: Fix PR number in xfail.
+
 2022-04-23  Mark Wielaard  <mark@klomp.org>
 
 	* run-debuginfod-webapi-concurrency.sh: Lower parallel lookups.
diff --git a/tests/run-debuginfod-webapi-concurrency.sh b/tests/run-debuginfod-webapi-concurrency.sh
index 4928f6d0..47dcadcc 100755
--- a/tests/run-debuginfod-webapi-concurrency.sh
+++ b/tests/run-debuginfod-webapi-concurrency.sh
@@ -62,6 +62,8 @@ do
     PID1=0
 done
 
-xfail "grep Server.reached.connection vlog$PORT1" # PR18661
+# Note this xfail comes too late, the above wait_ready for
+# http_responses_transfer_bytes_count will have failed.
+xfail "grep Server.reached.connection vlog$PORT1" # PR28661
 
 exit 0
-- 
2.30.2


  reply	other threads:[~2022-04-24 10:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-23  1:19 ☠ Buildbot (GNU Toolchain): elfutils - failed test (failure) (master) builder
2022-04-23  1:31 ` Mark Wielaard
2022-04-23 20:19   ` run-debuginfod-webapi-concurrency.sh (Was: ☠ Buildbot (GNU Toolchain): elfutils - failed test (failure)) (master) Mark Wielaard
2022-04-23 21:45     ` Frank Ch. Eigler
2022-04-24  2:56       ` run-debuginfod-webapi-concurrency.sh Thomas Fitzsimmons
2022-04-24 10:22         ` Mark Wielaard [this message]
     [not found] <m31qxoh1yi.fsf@fitzsim.org>
     [not found] ` <YmPpq4OAsbrRKPB5@wildebeest.org>
2022-04-23 15:00   ` run-debuginfod-webapi-concurrency.sh Frank Ch. Eigler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YmUk+lhq1L5xVCEE@wildebeest.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=fche@redhat.com \
    --cc=fitzsim@fitzsim.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).