Ticket 49316 - Fix clock unsafety in DS
Bug Description: DS is heavily reliant on correct working time
for a variety of aspects. In almost every aspect of the server
we found a way to misuse time somehow. From timeouts only
checking second boundaries which would lead to timeouts of
less that 1 second in some cases, to enforcing 32bit times on
64bit platforms, confusion of absolute utc times and relative
offsets, incorrect time types (not time_t), wrapping thread
safe functions in mutexs causing import perf issues, and finally,
using not-threadsafe polling function to update an int
representing the current time, which may never be flushed
to the cache, nor other threads reading it.
tl;dr - what didn't we do wrong with time?
Fix Description: This fix has to cover a lot of ground:
* make clock_gettime a requirement of the server
* deprecate broken api's to create noise when people use them
* remove the clock thread
* replace access to clocks with clock_gettime
* add a clock_monotonic interface for timeouts which is
not affected by admin clock changes
* update search/add etc to use timespec timeouts rather
than time_t
* replace calls to the broken "current_time()" function
with a properly labeled utc or rel time function
* fix checkpoint thread to run compact indepedent to
checkpoints
* remove incorrectly defined gmtime_r functions
* remove incorrect documentation about atomicity of statics
in the server
* fix locations that used time as an int to time_t (2038 work)
* deprecate long and long long value parser for time replacing
with time_t to prevent 2038 issues
https://pagure.io/389-ds-base/issue/49316
Author: wibrown
Review by: mreynolds (Thank you so much!)