You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/04/14 12:12:04 UTC

[GitHub] [incubator-doris] weizuo93 commented on a change in pull request #5651: [Compaction] Support to switching cumulative compaction policy dynamically

weizuo93 commented on a change in pull request #5651:
URL: https://github.com/apache/incubator-doris/pull/5651#discussion_r613190823



##########
File path: be/src/common/configbase.cpp
##########
@@ -338,7 +340,11 @@ bool init(const char* conf_file, bool fill_conf_map, bool must_exist, bool set_t
         SET_FIELD(it.second, int32_t, fill_conf_map, set_to_default);
         SET_FIELD(it.second, int64_t, fill_conf_map, set_to_default);
         SET_FIELD(it.second, double, fill_conf_map, set_to_default);
-        SET_FIELD(it.second, std::string, fill_conf_map, set_to_default);
+        {
+            // add lock to ensure thread safe
+            std::lock_guard<std::mutex> lock(mutable_string_config_lock);
+            SET_FIELD(it.second, std::string, fill_conf_map, set_to_default);
+        }

Review comment:
       > `init` is called in main when no other threads created, is it needed to use lock?
   
   Thanks, you are right.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org