[gnutls-devel] GnuTLS | priority: rework config reloading logic and locking (!1483)
Read-only notification of GnuTLS library development activities
gnutls-devel at lists.gnutls.org
Fri Nov 5 11:15:41 CET 2021
Alexander Sosedkin commented on a discussion on lib/priority.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1483#note_725023497
> + if (system_priority_file_loaded &&
> sb.st_mtime == system_priority_last_mod) {
> _gnutls_debug_log("cfg: system priority %s has not changed\n",
> system_priority_file);
> goto out;
> }
>
> - _name_val_array_clear(&system_wide_priority_strings);
> - system_wide_priority_strings_init = 0;
> + GNUTLS_STATIC_RWLOCK_UNLOCK(system_wide_config_rwlock);
> +
> + GNUTLS_STATIC_RWLOCK_WRLOCK(system_wide_config_rwlock);
> +
> + /* Another thread has updated the system wide config while upgrading to
> + * write lock. */
> + if (system_priority_last_mod >= sb.st_mtime) {
I'd rather strongly prefer we revert to the previous strict `!=` check and thus end up loading what's chronologically read from disk later, no matter what its relative mtime jump sign was. I think this leads to the least surprising behaviour possible.
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1483#note_725023497
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20211105/51c2c868/attachment.html>
More information about the Gnutls-devel
mailing list