[patch] debuginfod metadata query timeout enforcement
Aaron Merey
amerey@redhat.com
Thu Sep 5 01:36:08 GMT 2024
Hi Frank,
On Tue, Sep 3, 2024 at 11:34 AM Frank Ch. Eigler <fche@elastic.org> wrote:
>
> Hi -
>
> Proposed patch for a problem we spotted recently in unreleased code:
>
> commit b853004e723d058f97362dbfdc40d1c49ea2ef51 (HEAD -> main)
> Author: Frank Ch. Eigler <fche@redhat.com>
> Date: Tue Sep 3 11:27:36 2024 -0400
>
> debuginfod: service metadata queries in separate, timed-out connections
>
> The --metadata-maxtime=SECONDS parameter was intended to limit elapsed
> time debuginfod spends attempting to answer metadata queries. These
> can be slow because they have to apply glob matches across a large set
> of strings, potentially taking many seconds.
>
> However, this option was not implemented fully. It checked for
> timeouts only when rows of data were finally served up by the
> database, not during. Also, it used the same database connection that
> normal debuginfod queries were using, locking them out.
>
> New code creates a new temporary database connection for these
> infrequent(?) metadata queries, and enforces timeouts using the
> sqlite3 progress-handler callback. This effectively limits total
> query runtime, inside or outside the database.
>
> The elfutils testsuite dataset is not large enough to show either the
> slow-glob or the locking-out-normal-queries phenomenon, so the
> behavioral impact was hand-tested on a moderate sized debuginfod index
> on a live federation server. A full valgrind leak check indicated
> it's clean.
>
> Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
It isn't practical to add a testcase for this but you have rigorously
tested it by hand. LGTM.
Aaron
More information about the Elfutils-devel
mailing list