MB-23750: Fix toggling ephemeral ejection policy 94/76394/11
authorJames Harrison <00jamesh@gmail.com>
Thu, 6 Apr 2017 12:23:38 +0000 (13:23 +0100)
committerDave Rigby <daver@couchbase.com>
Tue, 11 Apr 2017 11:06:03 +0000 (11:06 +0000)
commit66b2fdaea77eadf80d48223e95a0b911a08a2991
tree01df2f8d9d52b211136acad9740b2555c8ef7fdb
parenta60943afa0062e3a8f6b92df4d089de95ddf4836
MB-23750: Fix toggling ephemeral ejection policy

If going

auto_delete -> fail_new_data -> auto_delete

the itemPager task was rescheduled, but as it had previously been
cancelled the state remained TASK_DEAD, and so ExecutorThread::run
behaves as if the task has just been cancelled and needs cleaning up.
By resetting scheduled tasks back to TASK_RUNNING if they are dead, this
can be avoided.

Change-Id: Id007a15fdaeb80a79828da0cade031a424e653cf
Reviewed-on: http://review.couchbase.org/76394
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
src/syncobject.h
src/taskqueue.cc
tests/module_tests/executorpool_test.cc
tests/module_tests/executorpool_test.h