[Bug debuginfod/27982] added DEBUGINFOD_MAXSIZE and DEBUGINFOD_MAXTIME

Mark Wielaard mark@klomp.org
Thu Jul 29 13:36:00 GMT 2021


Hi Noah,

On Mon, 2021-07-26 at 14:56 -0400, Noah Sanci via Elfutils-devel wrote:
> Please find the attached patch for pr 27982. DEBUGINFOD_MAXSIZE and
> MAXTIME were added in this patch to allow users to use more
> constraints when downloading debuginfo.

This looks good. Some high level comments (because I don't actually
know much about http requests).

Why have MAXTIME default to LONG_MAX? Which is long, but different on
different arches 32/64bit. If MAXSIZE == 0 means infinite, why not make
 MAXTIME=0 the same for consistency?

An alternative of passing around the X-DEBUGINFOD-MAXSIZE header is
doing it all at the client side if we supported HEAD. See PR27277. Did
you consider that route?

The bug suggests to also check the Content-Length header on reciept (in
case the server didn't support or respect the X-DEBUGINFOD-MAXSIZE
header. Did you try to implement that?

I believe various error handling goto out1 should be goto out2 (after
your duplicate urls patch). Could you double check that?

I had to make this little tweak to make the testcase pass on my setup
(because PWD contains symlinks):

diff --git a/tests/run-debuginfod-find.sh b/tests/run-debuginfod-find.sh
index feec5ddf..8ed7743d 100755
--- a/tests/run-debuginfod-find.sh
+++ b/tests/run-debuginfod-find.sh
@@ -187,7 +187,7 @@ tempfiles find-vlog$PORT1
 # wait for the server to fail the same number of times the query is retried.
 wait_ready $PORT1 'http_responses_after_you_milliseconds_count{code="406"}' 1
 # quickly ensure all reporting is functional
-grep 'serving file '${PWD}'/F/p+r%o\$g.debug' vlog$PORT1
+grep 'serving file '$(realpath ${PWD})'/F/p+r%o\$g.debug' vlog$PORT1
 grep 'File too large' vlog$PORT1
 grep 'using max size 1B' find-vlog$PORT1
 if [ -f ${DEBUGINFOD_CACHE_PATH}/${BUILDID} ]; then

Cheers,

Mark


More information about the Elfutils-devel mailing list