1
0
mirror of https://github.com/Zygo/bees.git synced 2025-07-01 00:02:27 +02:00

roots: don't share a RootFetcher between threads

If the send workaround is enabled, it is possible for two threads (a
thread running the crawl_new task, and a thread attempting to apply the
send workaround) to access the same RootFetcher object at the same time.
That never ends well.

Give each function its own BtrfsRootFetcher object.

Fixes: https://github.com/Zygo/bees/issues/250
Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
Zygo Blaxell
2023-02-20 11:13:18 -05:00
parent fd6c3b3769
commit d5a99c2f5e
2 changed files with 4 additions and 4 deletions

View File

@ -534,7 +534,6 @@ class BeesScanMode;
class BeesRoots : public enable_shared_from_this<BeesRoots> {
shared_ptr<BeesContext> m_ctx;
BtrfsRootFetcher m_root_fetcher;
BeesStringFile m_crawl_state_file;
map<uint64_t, shared_ptr<BeesCrawl>> m_root_crawl_map;
mutex m_mutex;