caching failed lookups of debuginfo?

Mark Wielaard mark@klomp.org
Fri Apr 8 22:40:27 GMT 2022


Hi Milian,

On Sat, Apr 09, 2022 at 12:23:32AM +0200, Milian Wolff wrote:
> ```
> # first we stat the target cache path
> if (stat(target_cache_path, &st) == 0
>   {
> 
>   # then we pass _the same st_ to
>   debuginfod_config_cache(cache_miss_path, cache_miss_default_s, &st)
> 
>   # which internally will do 
>   stat(config_path, st)
> 
>   # then we check the time delta
>   time(NULL) - st.st_mtime <= cache_miss
> ```
> 
> I.e. when we check the time delta, we only take the time stamp of the 
> `config_path` into account - the time stamp of the `target_cache_path` is 
> ignored.

O, wow. Yes, reusing the struct st is bad.

> I mount my filesystems with relatime (old advise for ssd's, probably not 
> relevant anymore?). I guess that's the issue then?

No, I think this is unrelated.

> Can we change the above code to store the `st.st_mtime` for 
> `target_cache_path` and use that for comparison purposes? That fixes the issue 
> for my case. If this is acceptable, I'll provide a patch.

Yes please. Thanks so much for finding this.

I think we as developers keep clearing the cache to test stuff.  But
that means we recreate the cache_miss file every time, so that gets a
new mtime. And if you are just testing for 10 minutes everything looks
fine...

Cheers,

Mark



More information about the Elfutils-devel mailing list