public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: "Dmitry V. Levin" <ldv@altlinux.org>
Cc: elfutils-devel@sourceware.org
Subject: Re: Buildbot failure in Wildebeest Builder on whole buildset
Date: Wed, 8 Sep 2021 00:04:25 +0200	[thread overview]
Message-ID: <YTfh6foWzW5xjiOw@wildebeest.org> (raw)
In-Reply-To: <20210907083416.GA27352@altlinux.org>

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

Hi,

On Tue, Sep 07, 2021 at 11:34:16AM +0300, Dmitry V. Levin wrote:
> On Tue, Sep 07, 2021 at 02:12:18AM +0200, Mark Wielaard wrote:
> [...]
> > Subject: [PATCH] tests: Make sure to wait for initial scan and groom cycle
> > 
> > At startup the debuginfod server does a scan and groom cycle. Make
> > sure to wait for that before triggering a new one with SIGUSR1 or
> > SIGURST2.
> 
> Did you mean SIGUSR2?

Sigh. Yes, that was a typo. Sorry.

It seems this did help with the debuginfod testcases. But we were
still seeing some failures on some of the buildbots because it wasn't
early enough. We really should wait for the initial scan (and possibly
groom) cycle to be done before we make any changes to the scan
directories. Otherwise only part of them might be scanned (or groomed)
at the start (especially because some tests populate the scan dirs and
then remove some files, which aren't supported, again).

The attached (pushed) fixes that hopefully.

Cheers,

Mark

[-- Attachment #2: 0001-tests-Make-sure-to-wait-for-initial-scan-and-groom-c.patch --]
[-- Type: text/x-diff, Size: 8771 bytes --]

From 5ce85e424907d82797f5efe59a8416ec537ebd9e Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Tue, 7 Sep 2021 23:56:42 +0200
Subject: [PATCH] tests: Make sure to wait for initial scan and groom cycle
 earlier

At startup the debuginfod server does a scan and groom cycle. Make
sure to wait for that before making any changes to the scan dirs.  And
not just right before triggering a new one with SIGUSR1 for scan or
SIGURS2 for groom.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 tests/ChangeLog                          | 12 ++++++++++++
 tests/run-debuginfod-archive-groom.sh    | 10 +++++++---
 tests/run-debuginfod-archive-rename.sh   | 11 +++++++----
 tests/run-debuginfod-artifact-running.sh | 12 +++++++-----
 tests/run-debuginfod-dlopen.sh           |  7 ++++---
 tests/run-debuginfod-extraction.sh       |  6 ++++--
 tests/run-debuginfod-federation-link.sh  |  3 +--
 7 files changed, 42 insertions(+), 19 deletions(-)

diff --git a/tests/ChangeLog b/tests/ChangeLog
index 61080c52..42989d19 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,15 @@
+2021-09-07  Mark Wielaard  <mark@klomp.org>
+
+	* run-debuginfod-archive-groom.sh: Wait for initial scan and groom
+	cycle before making any changes to the scan dirs.
+	* run-debuginfod-archive-rename.sh: Likewise.
+	* run-debuginfod-artifact-running.sh: Wait for initial scan cycle
+	before making any changes to the scan dirs.
+	* run-debuginfod-dlopen.sh: Likewise.
+	* run-debuginfod-extraction.sh: Likewise.
+	* run-debuginfod-federation-link.sh: Don't wait twice for the initial
+	scan.
+
 2021-09-06  Mark Wielaard  <mark@klomp.org>
 
 	* run-debuginfod-archive-groom.sh: Wait for initial scan and groom
diff --git a/tests/run-debuginfod-archive-groom.sh b/tests/run-debuginfod-archive-groom.sh
index 1e7bd67a..7813ee28 100755
--- a/tests/run-debuginfod-archive-groom.sh
+++ b/tests/run-debuginfod-archive-groom.sh
@@ -46,6 +46,13 @@ ps -q $PID1 -e -L -o '%p %c %a' | grep groom
 ps -q $PID1 -e -L -o '%p %c %a' | grep scan
 ps -q $PID1 -e -L -o '%p %c %a' | grep traverse
 
+# wait till the initial scan is done before triggering a new one
+# and before dropping new file into the scan dirs
+wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
+# Same for the initial groom cycle, we don't want it to be done
+# half way initializing the file setup
+wait_ready $PORT1 'thread_work_total{role="groom"}' 1
+
 # Build a non-stripped binary
 echo "int main() { return 0; }" > ${PWD}/F/prog.c
 gcc -Wl,--build-id -g -o ${PWD}/F/prog ${PWD}/F/prog.c
@@ -58,8 +65,6 @@ if [ "$zstd" = "false" ]; then  # nuke the zstd fedora 31 ones
     rm -vrf R/debuginfod-rpms/fedora31
 fi
 
-# wait till the initial scan is done before triggering a new one
-wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
 kill -USR1 $PID1
 # Now there should be 1 files in the index
 wait_ready $PORT1 'thread_work_total{role="traverse"}' 2
@@ -140,7 +145,6 @@ RPM_BUILDID=d44d42cbd7d915bc938c81333a21e355a6022fb7 # in rhel6/ subdir
 # debuginfod has forgotten them, but remembers others
 rm -r R/debuginfod-rpms/rhel6/*
 
-wait_ready $PORT1 'thread_work_total{role="groom"}' 1
 kill -USR2 $PID1  # groom cycle
 ## 1 groom cycle already took place at/soon-after startup, so -USR2 makes 2
 wait_ready $PORT1 'thread_work_total{role="groom"}' 2
diff --git a/tests/run-debuginfod-archive-rename.sh b/tests/run-debuginfod-archive-rename.sh
index 4fc1b441..5369949b 100755
--- a/tests/run-debuginfod-archive-rename.sh
+++ b/tests/run-debuginfod-archive-rename.sh
@@ -44,13 +44,18 @@ ps -q $PID1 -e -L -o '%p %c %a' | grep groom
 ps -q $PID1 -e -L -o '%p %c %a' | grep scan
 ps -q $PID1 -e -L -o '%p %c %a' | grep traverse
 
+# wait till the initial scan is done before triggering a new one
+# and before dropping new file into the scan dirs
+wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
+# Same for the initial groom cycle, we don't want it to be done
+# half way initializing the file setup
+wait_ready $PORT1 'thread_work_total{role="groom"}' 1
+
 cp -rvp ${abs_srcdir}/debuginfod-rpms R
 if [ "$zstd" = "false" ]; then  # nuke the zstd fedora 31 ones
     rm -vrf R/debuginfod-rpms/fedora31
 fi
 
-# Make sure the initial scan is done
-wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
 kill -USR1 $PID1
 # Now there should be 1 files in the index
 wait_ready $PORT1 'thread_work_total{role="traverse"}' 2
@@ -65,8 +70,6 @@ SHA=f4a1a8062be998ae93b8f1cd744a398c6de6dbb1
 # there are two copies of the same buildid in the index, one for the
 # no-longer-existing file name, and one under the new name.
 
-# Make sure the initial groom cycle has been done
-wait_ready $PORT1 'thread_work_total{role="groom"}' 1
 # run a groom cycle to force server to drop its fdcache
 kill -USR2 $PID1  # groom cycle
 wait_ready $PORT1 'thread_work_total{role="groom"}' 2
diff --git a/tests/run-debuginfod-artifact-running.sh b/tests/run-debuginfod-artifact-running.sh
index 4eae0200..51fa9c0a 100755
--- a/tests/run-debuginfod-artifact-running.sh
+++ b/tests/run-debuginfod-artifact-running.sh
@@ -42,6 +42,13 @@ env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -d
 PID1=$!
 tempfiles vlog$PORT1
 errfiles vlog$PORT1
+
+# Server must become ready
+wait_ready $PORT1 'ready' 1
+# And the initial scan should have been done before moving
+# files under the scan dirs.
+wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
+
 mv prog F
 mv prog.debug F
 tempfiles prog/F
@@ -49,11 +56,6 @@ tempfiles prog/F
 # Be patient when run on a busy machine things might take a bit.
 export DEBUGINFOD_TIMEOUT=10
 
-# Server must become ready
-wait_ready $PORT1 'ready' 1
-# And the initial scan should have been done
-wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
-
 kill -USR1 $PID1
 wait_ready $PORT1 'thread_work_total{role="traverse"}' 2
 wait_ready $PORT1 'thread_work_pending{role="scan"}' 0
diff --git a/tests/run-debuginfod-dlopen.sh b/tests/run-debuginfod-dlopen.sh
index 5f33394a..39ee5190 100755
--- a/tests/run-debuginfod-dlopen.sh
+++ b/tests/run-debuginfod-dlopen.sh
@@ -51,6 +51,10 @@ ps -q $PID1 -e -L -o '%p %c %a' | grep groom
 ps -q $PID1 -e -L -o '%p %c %a' | grep scan
 ps -q $PID1 -e -L -o '%p %c %a' | grep traverse
 
+# Make sure the initial scan has finished.
+# Before moving files under the scan dirs.
+wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
+
 # We use -t0 and -g0 here to turn off time-based scanning & grooming.
 # For testing purposes, we just sic SIGUSR1 / SIGUSR2 at the process.
 
@@ -71,9 +75,6 @@ BUILDID=`env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../src/readelf \
 mv p+r%o\$g F
 mv p+r%o\$g.debug F
 
-# Make sure the initial scan has finished.
-wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
-
 kill -USR1 $PID1
 # Wait till both files are in the index.
 wait_ready $PORT1 'thread_work_total{role="traverse"}' 2
diff --git a/tests/run-debuginfod-extraction.sh b/tests/run-debuginfod-extraction.sh
index 4750f184..06f60e78 100755
--- a/tests/run-debuginfod-extraction.sh
+++ b/tests/run-debuginfod-extraction.sh
@@ -47,6 +47,10 @@ ps -q $PID1 -e -L -o '%p %c %a' | grep groom
 ps -q $PID1 -e -L -o '%p %c %a' | grep scan
 ps -q $PID1 -e -L -o '%p %c %a' | grep traverse
 
+# Make sure the initial scan has finished before copying the new files in
+# We might remove some, which we don't want to be accidentially scanned.
+wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
+
 cp -rvp ${abs_srcdir}/debuginfod-rpms R
 if [ "$zstd" = "false" ]; then  # nuke the zstd fedora 31 ones
     rm -vrf R/debuginfod-rpms/fedora31
@@ -54,8 +58,6 @@ fi
 
 cp -rvp ${abs_srcdir}/debuginfod-tars Z
 
-# Make sure the initial scan has finished
-wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
 kill -USR1 $PID1
 # Wait till both files are in the index and scan/index fully finished
 wait_ready $PORT1 'thread_work_total{role="traverse"}' 2
diff --git a/tests/run-debuginfod-federation-link.sh b/tests/run-debuginfod-federation-link.sh
index 1aef7174..050bcbcf 100755
--- a/tests/run-debuginfod-federation-link.sh
+++ b/tests/run-debuginfod-federation-link.sh
@@ -43,6 +43,7 @@ tempfiles vlog$PORT1
 errfiles vlog$PORT1
 
 wait_ready $PORT1 'ready' 1
+# Make sure initial scan was done
 wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
 wait_ready $PORT1 'thread_work_pending{role="scan"}' 0
 wait_ready $PORT1 'thread_busy{role="scan"}' 0
@@ -63,8 +64,6 @@ BUILDID=`env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../src/readelf \
 mv prog F
 mv prog.debug F
 
-# Make sure initial scan was done
-wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
 kill -USR1 $PID1
 # Wait till both files are in the index.
 wait_ready $PORT1 'thread_work_total{role="traverse"}' 2
-- 
2.32.0


  reply	other threads:[~2021-09-07 22:04 UTC|newest]

Thread overview: 153+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03 14:08 buildbot
2021-09-03 23:47 ` Mark Wielaard
2021-09-06 15:07   ` Mark Wielaard
2021-09-06 20:02     ` Mark Wielaard
2021-09-06 21:14       ` Mark Wielaard
2021-09-07  0:12       ` Mark Wielaard
2021-09-07  8:34         ` Dmitry V. Levin
2021-09-07 22:04           ` Mark Wielaard [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-07 20:27 buildbot
2022-02-07 20:46 ` Mark Wielaard
2022-02-07 22:29   ` Mark Wielaard
2022-02-08 10:18     ` Mark Wielaard
2022-01-07 18:02 buildbot
2021-12-21 16:34 buildbot
2021-12-21 13:36 buildbot
2021-12-17 18:34 buildbot
2021-12-16  1:10 buildbot
2021-12-16 17:05 ` Mark Wielaard
2021-12-10 19:56 buildbot
2021-12-11 16:16 ` Mark Wielaard
2021-12-08 17:20 buildbot
2021-12-08 22:08 ` Mark Wielaard
2021-11-15 10:56 buildbot
2021-11-15 11:37 ` Mark Wielaard
2021-11-04 20:14 buildbot
2021-11-05  9:28 ` Mark Wielaard
2021-10-18 13:45 buildbot
2021-10-18 13:50 ` Mark Wielaard
2021-09-16 15:00 buildbot
2021-09-16 16:16 ` Mark Wielaard
2021-09-12 23:16 buildbot
2021-09-13  9:06 ` Mark Wielaard
2021-09-14 11:05   ` Mark Wielaard
2021-09-12 21:56 buildbot
2021-09-12 22:30 ` Mark Wielaard
2021-09-10  5:54 buildbot
2021-09-10  4:42 buildbot
2021-09-10  1:00 buildbot
2021-09-09 16:05 buildbot
2021-09-07  1:51 buildbot
2021-09-07  0:29 buildbot
2021-09-06 21:44 buildbot
2021-09-03 10:33 buildbot
2021-09-03 11:14 ` Mark Wielaard
2021-08-27 23:19 buildbot
2021-08-28 14:01 ` Mark Wielaard
2021-08-28 14:41   ` Frank Ch. Eigler
2021-08-27 21:20 buildbot
2021-08-28 12:29 ` Mark Wielaard
2021-08-11 23:16 buildbot
2021-08-23 20:48 ` Mark Wielaard
2021-08-04 15:13 buildbot
2021-08-05 14:19 ` Mark Wielaard
2021-07-22 17:21 buildbot
2021-07-22 14:24 buildbot
2021-07-22 14:36 ` Mark Wielaard
2021-07-19 16:33 buildbot
2021-07-08  9:53 buildbot
2021-07-08  9:56 ` Mark Wielaard
2021-06-15 21:29 buildbot
2021-06-15 21:40 ` Mark Wielaard
2021-06-15 21:53   ` Frank Ch. Eigler
2021-06-15 22:14     ` Mark Wielaard
2021-06-15 23:00       ` Frank Ch. Eigler
2021-06-16  9:35         ` Mark Wielaard
2021-06-12 23:39 buildbot
2021-06-12 23:53 ` Mark Wielaard
2021-04-15 12:53 buildbot
2021-04-13 16:54 buildbot
2021-04-14 12:13 ` Mark Wielaard
2021-04-13 14:29 buildbot
2021-04-14 12:06 ` Mark Wielaard
2021-03-31 11:29 buildbot
2021-03-31 11:37 ` Mark Wielaard
2021-03-07 19:11 buildbot
2021-03-06 14:45 buildbot
2021-03-06 15:46 ` Mark Wielaard
2021-03-02 12:45 buildbot
2021-03-02 11:53 buildbot
2021-03-02  4:28 buildbot
2021-03-01 19:56 buildbot
2021-03-01 22:13 ` Mark Wielaard
2021-02-17 22:22 buildbot
2021-02-12 18:45 buildbot
2021-02-12 16:40 buildbot
2021-02-09  2:26 buildbot
2021-02-09  9:05 ` Mark Wielaard
2021-02-12 15:58   ` Mark Wielaard
2021-02-12 19:09     ` Mark Wielaard
2020-12-16 23:54 buildbot
2020-12-16 23:58 ` Mark Wielaard
2020-12-12 17:11 buildbot
2020-12-12 18:47 ` Mark Wielaard
2020-11-28  4:15 buildbot
2020-11-28 13:41 ` Mark Wielaard
2020-11-28 15:12   ` Mark Wielaard
2020-11-29  1:18     ` Mark Wielaard
2020-11-23 17:50 buildbot
2020-11-23 17:58 ` Mark Wielaard
2020-11-19 13:26 buildbot
2020-11-19 13:55 ` Mark Wielaard
2020-11-17 15:09 buildbot
2020-11-17 17:10 ` Mark Wielaard
2020-10-31  2:12 buildbot
2020-10-31 10:22 ` Mark Wielaard
2020-10-30 15:41 buildbot
2020-10-30  1:51 buildbot
2020-10-30  8:45 ` Mark Wielaard
2020-10-08 16:45 buildbot
2020-10-08 17:38 ` Mark Wielaard
2020-06-19 23:20 buildbot
2020-06-19 23:47 ` Mark Wielaard
2020-06-11 16:00 buildbot
2020-06-11 16:15 ` Mark Wielaard
2020-03-26 16:53 buildbot
2020-03-25 23:48 buildbot
2020-03-26  9:15 ` Mark Wielaard
2020-03-23 13:38 buildbot
2020-03-23 14:08 ` Mark Wielaard
2020-03-23 23:06   ` Mark Wielaard
2020-03-04 12:09 buildbot
2020-03-04 12:45 ` Mark Wielaard
2020-02-26 21:42 buildbot
2020-02-26 21:59 ` Mark Wielaard
2020-02-10 22:34 buildbot
2020-02-21 12:10 ` Mark Wielaard
2020-02-10 19:11 buildbot
2020-01-20 21:05 buildbot
2020-01-20 19:44 buildbot
2020-01-17  0:08 buildbot
2019-12-03  9:49 buildbot
2019-12-03 10:23 ` Mark Wielaard
2019-11-23  2:25 buildbot
2019-11-23  1:38 buildbot
2019-10-26  2:47 buildbot
2019-10-26 12:08 ` Mark Wielaard
2019-09-07 14:54 buildbot
2019-09-07 19:53 ` Mark Wielaard
2019-08-29 13:59 buildbot
2019-08-29 14:23 ` Mark Wielaard
2019-08-29 15:52   ` Mark Wielaard
2019-08-28 22:08 buildbot
2019-08-28 22:13 ` Mark Wielaard
2019-08-15  8:28 buildbot
2019-06-28 23:02 buildbot
2019-06-28 23:47 ` Mark Wielaard
2019-07-01 15:12   ` Mark Wielaard
2018-11-13 16:42 buildbot
2018-11-13 17:29 ` Mark Wielaard
2018-11-13 20:46   ` Mark Wielaard
2018-11-10 12:32 buildbot
2018-11-10 12:36 ` Mark Wielaard
2018-11-06 14:15 buildbot

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=YTfh6foWzW5xjiOw@wildebeest.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=ldv@altlinux.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).