public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: elfutils-devel@sourceware.org
Subject: Re: [Bug debuginfod/27277] Describe retrieved files when verbose
Date: Wed, 29 Sep 2021 16:55:05 +0200	[thread overview]
Message-ID: <599234fd5a36629b580d0a615ac069835295111f.camel@klomp.org> (raw)
In-Reply-To: <20210922203331.GC13236@redhat.com>

Hi Frank,

On Wed, 2021-09-22 at 16:33 -0400, Frank Ch. Eigler via Elfutils-devel
wrote:
> > from providing an interface to query what needs to be done to get
> > some file (is it in cache, can it be retieved from a remote server,
> > how
> > big is it?) I don't think providing raw http headers is that
> > interface.
> 
> Well, we have gone some way into this on PR28284, on various branches
> including nsanci/pr28284-webapi.  It's not complete, yet the "raw
> http
> headers" aspect is still there, because what headers are available is
> unpredictable.  But now this is made even more wordy by forking the
> _find_ functions into a _describe_ triplet and all the other leftover
> work elsewhere.
> 
> IMHO it's not an improvement over a single function that returns
> headers associated with the lookup.  Please let's discuss this again.

Looking at the nscanci/pr28284 branch I see the following proposed
interface for debuginfod-client:

/* The _describe_ variants of the query functions return a set of HTTP-like
   headers that would result from a new lookup.  No content is collected. 
   If successful, return zero, otherwise return a posix error code.  If
   successful, set *headers a strdup()'d copy of the headers.
   Caller must free() it later. */

int debuginfod_describe_debuginfo (debuginfod_client *client,
                                   const unsigned char *build_id,
                                   int build_id_len,
                                   char **headers);

int debuginfod_describe_executable (debuginfod_client *client,
                                    const unsigned char *build_id,
                                    int build_id_len,
                                    char **headers);

int debuginfod_describe_source (debuginfod_client *client,
                                const unsigned char *build_id,
                                int build_id_len,
                                const char *filename,
                                char **headers);

And if I understand your comments above correctly, you would rather see
a function like const char* debuginfod_get_url (debuginfod_client
*client); but for any headers. Would such a headers call be only be
accessible during debuginfod_progressfn_t callback or would it retain
the headers so they can be found after a debuginfod_find_* call (as
long as debuginfod_end hasn't been called on the client handle)?

Or do I misunderstand the various proposals?

Personally I don't really like an interface that relies on the program
having to parse somewhat arbitrary strings. I can see how it is useful
in verbose mode for the user to see the headers to know what is going
on (which we have now). But if the program needs to make any policy
decisions then what do we guarantee about the provided header strings?

What is the information the program really needs? I think that is a)
whether the requested file is already in cache, b) if not, whether it
can be retrieved from a server, and c) if so how big it is and/or how
many bytes need to be transferred from the server.

If the above seems reasonable information to provide to the program
then we can design a debuginfo-client interface based on that. Which
might or might not include the full headers to the program. But I might
be missing some important data or misinterpret the goal of the new
interface/information provided to the program.

Cheers,

Mark

  reply	other threads:[~2021-09-29 14:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04 18:54 Noah Sanci
2021-08-05 15:13 ` Mark Wielaard
2021-08-05 16:54   ` Frank Ch. Eigler
2021-08-06 10:04     ` Mark Wielaard
2021-08-06 18:54       ` Frank Ch. Eigler
2021-08-09  9:25         ` Mark Wielaard
2021-08-23 15:11           ` Noah Sanci
2021-08-24  8:18             ` Mark Wielaard
2021-08-27 18:38               ` Noah Sanci
2021-09-08 20:56                 ` Mark Wielaard
2021-09-10 18:22                   ` Noah Sanci
2021-09-12 19:08                     ` Mark Wielaard
2021-09-13 20:07                       ` Noah Sanci
2021-09-16 10:50                         ` Mark Wielaard
2021-09-22 20:33           ` Frank Ch. Eigler
2021-09-29 14:55             ` Mark Wielaard [this message]
2021-09-29 21:28               ` Frank Ch. Eigler
2021-10-05 14:28                 ` Mark Wielaard
2022-07-14 15:32                   ` Noah Sanci
2022-08-04 13:12                     ` Mark Wielaard
     [not found]                       ` <CAJXA7qg09YkxK-NRQ31Hem0+54Us=jYC5+1siPSbHangx=SCow@mail.gmail.com>
2022-08-08 14:35                         ` Mark Wielaard
2021-08-25 18:08 Noah Sanci
2021-09-08 15:01 ` Mark Wielaard

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=599234fd5a36629b580d0a615ac069835295111f.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=fche@redhat.com \
    /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).