Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check that we're removing the right root from watched_roots
Summary: There was a race where: 1. `watch-del` is called on a root, which causes it to be removed from `watched_roots` 2. `watch` is called immediately afterwards on the same root, which causes it to be re-added to `watched_roots`. 3. The notify thread for the first root completes, after which the *new* root gets removed from the `watched_roots` list. Fix this by checking before deleting. Test Plan: Added a `usleep(100000);` call right before the removal in `root.c:run_notify_thread`, and a `usleep(200000);` right after the second `watch` in `tests/integration/since.php:testReaddWatchFreshInstance`. This was enough to make the bug trigger reliably while running the test. With the fix it doesn't. Reviewers: wez Reviewed By: wez Differential Revision: https://phabricator.fb.com/D922818 --HG-- extra : rebase_source : 33ad24440d9b244f809ceddd746d6773352caa15 extra : amend_source : f218a450281b17eba03ac3788c3f35e51a902621
- Loading branch information