Commit a4004a61 authored by Ramon Nou's avatar Ramon Nou
Browse files

fix(fs): make redistribution state flag atomic

Use `std::atomic<bool>` for `redist_running_` to ensure safe concurrent access when clients check whether redistribution is running.
parent 5b92785a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@

#include <daemon/daemon.hpp>

#include <atomic>
#include <unordered_map>
#include <map>
#include <functional> //std::hash
@@ -138,7 +139,7 @@ private:
    bool maintenance_mode_ = false;
    ABT_mutex maintenance_mode_mutex_;
    // redist_running_ indicates to client that redistribution is running
    bool redist_running_ = false;
    std::atomic<bool> redist_running_{false};

    bool expand_on_demand_active_ = false;
    unsigned int expand_on_demand_old_hosts_size_ = 0;