diff options
author | petr@mysql.com <> | 2006-02-21 15:57:56 +0300 |
---|---|---|
committer | petr@mysql.com <> | 2006-02-21 15:57:56 +0300 |
commit | cb5e54e1bdd69257c5fbfb509c4d819a70b6b69c (patch) | |
tree | 97bed2340b3e2c7f36e6d1712661050cd07b1064 /server-tools/instance-manager/manager.cc | |
parent | 0766fb3a53d6e4e068a403ab2cb4588514337187 (diff) | |
download | mariadb-git-cb5e54e1bdd69257c5fbfb509c4d819a70b6b69c.tar.gz |
Fix race condition: instance map wasn't locked for the
duration of the whole 'flush instances'. As a consequence,
it was possible to query instance map, while it is in the
inconsistent state. The patch was reworked after review.
Diffstat (limited to 'server-tools/instance-manager/manager.cc')
-rw-r--r-- | server-tools/instance-manager/manager.cc | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/server-tools/instance-manager/manager.cc b/server-tools/instance-manager/manager.cc index 3ecd5fbc0d0..95f9029f648 100644 --- a/server-tools/instance-manager/manager.cc +++ b/server-tools/instance-manager/manager.cc @@ -135,15 +135,6 @@ void manager(const Options &options) if (instance_map.init() || user_map.init()) return; - - if (instance_map.load()) - { - log_error("Cannot init instances repository. This might be caused by " - "the wrong config file options. For instance, missing mysqld " - "binary. Aborting."); - return; - } - if (user_map.load(options.password_file_name)) return; @@ -207,12 +198,13 @@ void manager(const Options &options) shutdown_complete= FALSE; - /* init list of guarded instances */ - guardian_thread.lock(); - - guardian_thread.init(); - - guardian_thread.unlock(); + if (instance_map.flush_instances()) + { + log_error("Cannot init instances repository. This might be caused by " + "the wrong config file options. For instance, missing mysqld " + "binary. Aborting."); + return; + } /* After the list of guarded instances have been initialized, |