All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 0/3] Use aiohttp in pkg-stats
Date: Sat,  8 Aug 2020 20:08:22 +0200	[thread overview]
Message-ID: <20200808180826.1007656-1-thomas.petazzoni@bootlin.com> (raw)

Hello,

I started investigating why pkg-stats was sometimes stuck on the
server running it on a daily basis to populate
autobuild.buildroot.org/stats/ and send the autobuilder e-mails. The
subprocesses started by "multiprocessing" to retrieve the latest
upstream version from release-monitoring.org were stuck holding a
lock. Without providing a definitive conclusion, some preliminary
research showed that multiprocessing can be tricky and cause some
issues with locks.

Discussing this with Titouan, he suggested to use aiohttp instead of
multiprocessing. And indeed, it makes a lot of sense to use this
popular asynchronous HTTP library.

This patch series switches the latest version retrieval and the
upstream URL checking to aiohttp, and as a bonus adds some logging to
show the progress of the retrieval, as it can be quite long.

Changes since v2:

 - Use python3 in the shebang

 - Use asyncio.TimeoutError in the exception handling

 - Slightly rework how packages with "no valid infra" are handled in
   the "latest version" check, but we keep a loop to handle such
   packages before the main loop, as we want the real count of
   packages that the main loop will handle.

 - Use asyncio.get_event_loop() + loop.run_until_complete() instead of
   asyncio.run().

Changes since v1:

 - Pass trust_env=True when creating the aiohttp.ClientSession() so
   that HTTP proxy environment variables are taken into
   account. Suggested by Matt Weber.

 - Fix bogus indentation that was breaking the logic of the latest
   version retrieval.

Thanks,

Thomas


Thomas Petazzoni (3):
  support/scripts/pkg-stats: use aiohttp for latest version retrieval
  support/scripts/pkg-stats: use aiohttp for upstream URL checking
  support/scripts/pkg-stats: show progress of upstream URL and latest
    version

 support/scripts/pkg-stats | 213 ++++++++++++++++++++++----------------
 1 file changed, 126 insertions(+), 87 deletions(-)

-- 
2.26.2

             reply	other threads:[~2020-08-08 18:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-08 18:08 Thomas Petazzoni [this message]
2020-08-08 18:08 ` [Buildroot] [PATCH v3 1/3] support/scripts/pkg-stats: use aiohttp for latest version retrieval Thomas Petazzoni
2020-08-28 15:52   ` Peter Korsgaard
2020-08-08 18:08 ` [Buildroot] [PATCH v3 2/3] support/scripts/pkg-stats: use aiohttp for upstream URL checking Thomas Petazzoni
2020-08-28 15:52   ` Peter Korsgaard
2020-08-08 18:08 ` [Buildroot] [PATCH v3 3/3] support/scripts/pkg-stats: show progress of upstream URL and latest version Thomas Petazzoni
2020-08-28 15:52   ` Peter Korsgaard
2020-08-11 20:33 ` [Buildroot] [PATCH v3 0/3] Use aiohttp in pkg-stats Thomas Petazzoni
2020-08-28 15:52 ` Peter Korsgaard

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=20200808180826.1007656-1-thomas.petazzoni@bootlin.com \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.