[SSSD] [PATCH] negcache: Soften condition for expired entries

Lukas Slebodnik lslebodn at redhat.com
Wed May 20 11:39:34 UTC 2015


On (20/05/15 13:35), Lukas Slebodnik wrote:
>ehlo,
>
>Type of timestamp for entries in negative cache is time_t
>which is number of *seconds* that have elapsed since 1 January 1970.
>
>The condition for ttl was to strict so entry could be valid
> from  "ttl-1" to  ttl e.g.
> * ttl is 1 second
> * entry was stored to negative cache at 1432120871.999639
>   stored_timestamp = 1432120871
> * entry was tested few miliseconds later 1432120872.001293
>   current_time = 1432120872
>
>Entry was marked as expired becuase result of condition was false
>  stored_timestamp + ttl < current_time
>          1432120871 + 1 < 1432120872
>
>This is a reason why ./test-negcache sometime fails.
>It's quite easily reproducible on slow machine or when valgrind was used.
>
>sh$ while libtool --mode=execute valgrind ./test-negcache ; do echo OK: done
>
>It would be good to push patch to master and sssd-1-12.
>So we can get gid of problematic failed tests in CI.
>

I forgot to attach log from failed test. I added extra debugging to negcache.

(Tue May 19 09:47:08:994639 2015) [sssd] [sss_ncache_set_str] (0x0400): Adding [NCE/UID/499] to negative cache
(Tue May 19 09:47:09:003293 2015) [sssd] [sss_ncache_check_str] (0x2000): Checking negative cache for [NCE/UID/499]
(Tue May 19 09:47:09:003463 2015) [sssd] [sss_ncache_check_str] (0x0040): string_to_tdb_data returned [0]
(Tue May 19 09:47:09:004283 2015) [sssd] [sss_ncache_check_str] (0x0040): All checks passed, marking as expired
(Tue May 19 09:47:09:004711 2015) [sssd] [sss_ncache_check_str] (0x0040): timestamp: [1432021628] ttl: [1] now: [1432021629]
(Tue May 19 09:47:09:005385 2015) [sssd] [sss_ncache_check_str] (0x0040): value expired [0], setting to ENOENT
(Tue May 19 09:47:09:006539 2015) [sssd] [sss_ncache_check_uid] (0x0040): sss_ncache_check_str returned [2]
0x2 != 0x11
/var/lib/jenkins/workspace/ci/label/fedora_rawhide/src/tests/cmocka/test_negcache.c:227: error: Failure!

[  FAILED  ] test_sss_ncache_uid

Full log:
http://sssd-ci.duckdns.org/logs/job/15/37/fedora_rawhide/ci-build-debug/test-negcache.log

LS



More information about the sssd-devel mailing list