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 @@
##############################################################################
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
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
......
......@@ -177,10 +177,13 @@ void Listener::run()
return;
err:
log_error("Listener: failed to initialize. Initiate shutdown...");
// we have to close the ip sockets in case of error
for (i= 0; i < num_sockets; i++)
closesocket(sockets[i]);
thread_registry->set_error_status();
thread_registry->unregister_thread(&thread_info);
thread_registry->request_shutdown();
return;
......
......@@ -181,6 +181,9 @@ void Manager::stop_all_threads()
/* Stop all threads. */
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)
int Manager::main()
{
int rc= 1;
bool shutdown_complete= FALSE;
pid_t manager_pid= getpid();
......@@ -442,8 +444,6 @@ int Manager::main()
log_info("Manager: finished.");
rc= 0;
err:
/* delete the pid file */
my_delete(Options::Main::pid_file_name, MYF(0));
......@@ -452,7 +452,7 @@ int Manager::main()
/* free alarm structures */
end_thr_alarm(1);
#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)
Thread_registry::Thread_registry() :
shutdown_in_progress(FALSE)
,sigwait_thread_pid(pthread_self())
,error_status(FALSE)
{
pthread_mutex_init(&LOCK_thread_registry, 0);
pthread_cond_init(&COND_thread_registry_is_empty, 0);
......@@ -391,3 +392,23 @@ bool Thread::join()
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 @@ class Thread_registry
pthread_mutex_t *mutex);
int cond_timedwait(Thread_info *info, pthread_cond_t *cond,
pthread_mutex_t *mutex, struct timespec *wait_time);
int get_error_status();
void set_error_status();
private:
void interrupt_threads();
......@@ -154,6 +156,7 @@ class Thread_registry
pthread_mutex_t LOCK_thread_registry;
pthread_cond_t COND_thread_registry_is_empty;
pthread_t sigwait_thread_pid;
bool error_status;
private:
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