]> git.ipfire.org Git - thirdparty/elfutils.git/commit
debuginfod: service metadata queries in separate, timed-out connections
authorFrank Ch. Eigler <fche@redhat.com>
Tue, 3 Sep 2024 15:27:36 +0000 (11:27 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Tue, 3 Sep 2024 15:27:36 +0000 (11:27 -0400)
commitb853004e723d058f97362dbfdc40d1c49ea2ef51
tree3f5640120634bd9ea94970d84771b0f81ac00417
parent92ac55ef550a243dc0fab8b4c44cb217a4cb2524
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>
debuginfod/debuginfod.cxx