MB-21029: Don't return ep_access_scanner_task_time until it has been scheduled 43/67943/7
authorDave Rigby <daver@couchbase.com>
Fri, 23 Sep 2016 10:23:11 +0000 (11:23 +0100)
committerDave Rigby <daver@couchbase.com>
Tue, 27 Sep 2016 16:32:15 +0000 (16:32 +0000)
commitd9811c84b94028865e747f5ba36f2427bdaaeed3
tree7ee771dc90c1793e2890b99c0380db29bbe452dd
parent2da91b00e4de2417b7408fa8fd3a4434cc582055
MB-21029: Don't return ep_access_scanner_task_time until it has been scheduled

Fix a latent race condition in ep_access_scanner_task_time stat
(exposed by intermittent failure in access_scanner_settings test),
whereby we can return a value for ep_access_scanner_task_time of the
Unix epoch (1970-01-01 00:00:00) if the AccessScanner has been enabled
but not yet scheduled.

Solution is to not return a value (and instead 'NOT SCHEDULED') until
scheduling has occurred.

Change-Id: Id85a602b3424c30c8795884207a1b0d31cb3c75a
Reviewed-on: http://review.couchbase.org/67943
Reviewed-by: Manu Dhundi <manu@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
src/ep_engine.cc
tests/ep_testsuite.cc