Commit 1b0a3baa authored by unknown's avatar unknown

Merge alik.opbmk:/mnt/raid/alik/MySQL/devel/5.0-rt

into  alik.opbmk:/mnt/raid/alik/MySQL/devel/5.1-rt-merge


sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/t/disabled.def:
  Merge: enabled im_daemon_life_cycle.imtest
mysql-test/t/view.test:
  Manual merge.
server-tools/instance-manager/listener.cc:
  Manual merge.
server-tools/instance-manager/manager.cc:
  Manual merge.
server-tools/instance-manager/manager.h:
  Manual merge.
server-tools/instance-manager/mysqlmanager.cc:
  Manual merge.
server-tools/instance-manager/thread_registry.cc:
  Manual merge.
server-tools/instance-manager/thread_registry.h:
  Manual merge.
parents ce00eac6 4bb9efa6
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
############################################################################## ##############################################################################
user_limits : Bug#23921 random failure of user_limits.test user_limits : Bug#23921 random failure of user_limits.test
im_daemon_life_cycle : Bug#24415 see note: [19 Dec 23:17] Trudy Pelzer
im_options : Bug#20294 2006-07-24 stewart Instance manager test im_options fails randomly im_options : Bug#20294 2006-07-24 stewart Instance manager test im_options fails randomly
concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences
ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
......
...@@ -177,10 +177,13 @@ void Listener::run() ...@@ -177,10 +177,13 @@ void Listener::run()
return; return;
err: err:
log_error("Listener: failed to initialize. Initiate shutdown...");
// we have to close the ip sockets in case of error // we have to close the ip sockets in case of error
for (i= 0; i < num_sockets; i++) for (i= 0; i < num_sockets; i++)
closesocket(sockets[i]); closesocket(sockets[i]);
thread_registry->set_error_status();
thread_registry->unregister_thread(&thread_info); thread_registry->unregister_thread(&thread_info);
thread_registry->request_shutdown(); thread_registry->request_shutdown();
return; return;
......
...@@ -181,6 +181,9 @@ void Manager::stop_all_threads() ...@@ -181,6 +181,9 @@ void Manager::stop_all_threads()
/* Stop all threads. */ /* Stop all threads. */
p_thread_registry->deliver_shutdown(); p_thread_registry->deliver_shutdown();
/* Set error status in the thread registry. */
p_thread_registry->set_error_status();
} }
...@@ -248,7 +251,6 @@ bool Manager::init_user_map(User_map *user_map) ...@@ -248,7 +251,6 @@ bool Manager::init_user_map(User_map *user_map)
int Manager::main() int Manager::main()
{ {
int rc= 1;
bool shutdown_complete= FALSE; bool shutdown_complete= FALSE;
pid_t manager_pid= getpid(); pid_t manager_pid= getpid();
...@@ -442,8 +444,6 @@ int Manager::main() ...@@ -442,8 +444,6 @@ int Manager::main()
log_info("Manager: finished."); log_info("Manager: finished.");
rc= 0;
err: err:
/* delete the pid file */ /* delete the pid file */
my_delete(Options::Main::pid_file_name, MYF(0)); my_delete(Options::Main::pid_file_name, MYF(0));
...@@ -452,7 +452,7 @@ err: ...@@ -452,7 +452,7 @@ err:
/* free alarm structures */ /* free alarm structures */
end_thr_alarm(1); end_thr_alarm(1);
#endif #endif
return rc; return thread_registry.get_error_status() ? 1 : 0;
} }
......
...@@ -52,6 +52,7 @@ void Thread_info::init(bool send_signal_on_shutdown_arg) ...@@ -52,6 +52,7 @@ void Thread_info::init(bool send_signal_on_shutdown_arg)
Thread_registry::Thread_registry() : Thread_registry::Thread_registry() :
shutdown_in_progress(FALSE) shutdown_in_progress(FALSE)
,sigwait_thread_pid(pthread_self()) ,sigwait_thread_pid(pthread_self())
,error_status(FALSE)
{ {
pthread_mutex_init(&LOCK_thread_registry, 0); pthread_mutex_init(&LOCK_thread_registry, 0);
pthread_cond_init(&COND_thread_registry_is_empty, 0); pthread_cond_init(&COND_thread_registry_is_empty, 0);
...@@ -391,3 +392,23 @@ bool Thread::join() ...@@ -391,3 +392,23 @@ bool Thread::join()
return pthread_join(id, NULL) != 0; return pthread_join(id, NULL) != 0;
} }
int Thread_registry::get_error_status()
{
int ret_error_status;
pthread_mutex_lock(&LOCK_thread_registry);
ret_error_status= error_status;
pthread_mutex_unlock(&LOCK_thread_registry);
return ret_error_status;
}
void Thread_registry::set_error_status()
{
pthread_mutex_lock(&LOCK_thread_registry);
error_status= TRUE;
pthread_mutex_unlock(&LOCK_thread_registry);
}
...@@ -143,6 +143,8 @@ public: ...@@ -143,6 +143,8 @@ public:
pthread_mutex_t *mutex); pthread_mutex_t *mutex);
int cond_timedwait(Thread_info *info, pthread_cond_t *cond, int cond_timedwait(Thread_info *info, pthread_cond_t *cond,
pthread_mutex_t *mutex, struct timespec *wait_time); pthread_mutex_t *mutex, struct timespec *wait_time);
int get_error_status();
void set_error_status();
private: private:
void interrupt_threads(); void interrupt_threads();
...@@ -154,6 +156,7 @@ private: ...@@ -154,6 +156,7 @@ private:
pthread_mutex_t LOCK_thread_registry; pthread_mutex_t LOCK_thread_registry;
pthread_cond_t COND_thread_registry_is_empty; pthread_cond_t COND_thread_registry_is_empty;
pthread_t sigwait_thread_pid; pthread_t sigwait_thread_pid;
bool error_status;
private: private:
Thread_registry(const Thread_registry &); Thread_registry(const Thread_registry &);
......
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