-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MB-43546: Fix race between FollyExecutorPool::cancel & snooze
There is a potential race in FollyExecutorPool between the cancel() and snooze() methods. Unlike CB3ExecutorPool, cancel() isn't a completely blocking operation - while the task _is_ marked as cancelled synchronously; the actual deletion of the TaskProxy object is done lazily in the background after cancel() returns. This requires that other task operations (e.g. wake, snooze) check the GlobalTask is not null before oeprating on it. This is correctly handled for wake (see TaskProxy::wake), but _not_ for cancel. As a result a snooze() which executes before the background cleanup of taskOwners can result in a nullptr dereference. Change-Id: I8ef476426b1056bfff646551fa38d94f4ff64f01 Reviewed-on: http://review.couchbase.org/c/kv_engine/+/144166 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Trond Norbye <trond.norbye@couchbase.com>
- Loading branch information
Showing
2 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters