Commit 933db613 authored by unknown's avatar unknown

Fix for BUG#10957 "stop instance, issued after flush instances causes IM to crash"

Recommited with post-review fixes


server-tools/instance-manager/instance.cc:
  fix behaviour of monitoring routines: they should not  rely on the fact that instance object
  which was used when the instances started exists at stop(). Instead routines should save the
  name of the instance and look for it in the instance_map when needed.
server-tools/instance-manager/instance.h:
  new functions declared. functions, which were converted to static removed from the class.
server-tools/instance-manager/instance_options.cc:
  fix valgrind warning
parent 8fd77a04
This diff is collapsed.
...@@ -41,7 +41,8 @@ class Instance ...@@ -41,7 +41,8 @@ class Instance
/* send a signal to the instance */ /* send a signal to the instance */
void kill_instance(int signo); void kill_instance(int signo);
int is_crashed(); int is_crashed();
void fork_and_monitor(); void set_crash_flag_n_wake_all();
Instance_map *Instance::get_map();
public: public:
enum { DEFAULT_SHUTDOWN_DELAY= 35 }; enum { DEFAULT_SHUTDOWN_DELAY= 35 };
...@@ -63,7 +64,6 @@ class Instance ...@@ -63,7 +64,6 @@ class Instance
Instance_map *instance_map; Instance_map *instance_map;
void remove_pid(); void remove_pid();
int launch_and_wait();
}; };
#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_H */ #endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_H */
...@@ -130,6 +130,8 @@ int Instance_options::fill_instance_version() ...@@ -130,6 +130,8 @@ int Instance_options::fill_instance_version()
version_option, sizeof(version_option))) version_option, sizeof(version_option)))
goto err; goto err;
bzero(result, MAX_VERSION_STRING_LENGTH);
rc= parse_output_and_get_value(cmd.buffer, mysqld_path, rc= parse_output_and_get_value(cmd.buffer, mysqld_path,
result, MAX_VERSION_STRING_LENGTH, result, MAX_VERSION_STRING_LENGTH,
GET_LINE); GET_LINE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment