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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]