core: don't drop timer expired but not yet processed when system date is changed 27/192227/2
authorHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 1 Nov 2018 04:38:43 +0000 (13:38 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 1 Nov 2018 04:45:29 +0000 (13:45 +0900)
commitbf843c82c0c714c884c67a01c561e75e58b77349
tree8ebd1f130c7ba59a2c313f5555666e359f98508b
parent2322db67fdc65ed5a6c66f38df5128048263f7c8
core: don't drop timer expired but not yet processed when system date is changed

There is difference between time set by the user and real elapsed time because of accuracy feature.
If you change the system date(or time) between these times, the timer drops.

You can easily reproduce it with the following command.
-----------------------------------------------------------
$ systemd-run --on-active=3s ls; sleep 3; date -s "`date`"
-----------------------------------------------------------

In the following command, the problem is rarely reproduced. But it exists.
---------------------------------------------------------------------------------------------
$ systemd-run --on-active=3s --timer-property=AccuracySec=1us ls ; sleep 1; date -s "`date`"
---------------------------------------------------------------------------------------------

Note : Global AccuracySec value.
----------------------------------------------------------------------
$ cat /etc/systemd/system.conf
DefaultTimerAccuracySec=1min
----------------------------------------------------------------------

Origin source: https://github.com/systemd/systemd/commit/fee04d7f3ab810e99b97535ca5fda2f9517acda9

Change-Id: Ibaaa89bec9c55f43336388ee85f07b89c1a50ea4
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
src/core/timer.c