]> git.tuebingen.mpg.de Git - dss.git/commit - dss.c
Fix compute_next_snapshot_time().
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 14 Nov 2017 02:19:58 +0000 (03:19 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 19 Nov 2017 01:53:33 +0000 (02:53 +0100)
commit7a6ff706b99f35a3f4f1ee116f49827dbdf15c64
tree517e2831410ef4eeb3a340430f350baa0fcd16f1
parentbe3b0326d868aed97fc4224dcbf0266c303d2871
Fix compute_next_snapshot_time().

The function computes the average idle time between snapshots and adds
this value to the completion time of the last snapshot to obtain the
start time for the next snapshot.

However, if the last snapshot happens to be incomplete, its completion
time is set to -1. Hence the computed next snapshot time is going to
be in the past, so we start the next snapshot immediately.

Although this is incorrect, the bug is benign because the correct next
snapshot time should also be in the past since we decided earlier to
create the snapshot which was now found incomplete.

Fix this by using the completion time of the last _complete_ snapshot
instead.
dss.c