Below is the list of changes that have just been committed into a local
5.1 repository of cps. When cps does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-11-09 20:38:03+03:00, petr@stripped +3 -0
Bug #21783 Instance Manager does not exit on fatal error
Return error code on fatal error (all the rest was already in place)
server-tools/instance-manager/manager.cc@stripped, 2006-11-09 20:38:01+03:00, petr@stripped +10 -7
return an error code from manager() in case of an error
server-tools/instance-manager/manager.h@stripped, 2006-11-09 20:38:01+03:00, petr@stripped +1 -1
manager now returns error code
server-tools/instance-manager/mysqlmanager.cc@stripped, 2006-11-09 20:38:01+03:00, petr@stripped +2 -6
return error code in case of an error during startup
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: petr
# Host: outpost.site
# Root: /home/cps/mysql/trees/mysql-5.1-runtime
--- 1.37/server-tools/instance-manager/manager.cc 2006-10-24 18:23:14 +04:00
+++ 1.38/server-tools/instance-manager/manager.cc 2006-11-09 20:38:01 +03:00
@@ -142,9 +142,9 @@
TODO: how about returning error status.
*/
-void manager()
+int manager()
{
- int err_code;
+ int err_code, rc= 0;
const char *err_msg;
bool shutdown_complete= FALSE;
@@ -172,7 +172,7 @@
if (instance_map.init())
{
log_error("Error: can not initialize instance list: out of memory.");
- return;
+ return 1;
}
/* Initialize user map and load password file. */
@@ -180,7 +180,7 @@
if (user_map.init())
{
log_error("Error: can not initialize user list: out of memory.");
- return;
+ return 1;
}
if ((err_code= user_map.load(Options::Main::password_file_name, &err_msg)))
@@ -199,7 +199,7 @@
else
{
log_error("Error: %s.", (const char *) err_msg);
- return;
+ return 1;
}
}
@@ -210,7 +210,7 @@
(int) manager_pid);
if (create_pid_file(Options::Main::pid_file_name, manager_pid))
- return; /* necessary logging has been already done. */
+ return 1; /* necessary logging has been already done. */
/*
Initialize signals and alarm-infrastructure.
@@ -235,7 +235,6 @@
{
pthread_t guardian_thd_id;
pthread_attr_t guardian_thd_attr;
- int rc;
/*
NOTE: Guardian should be shutdown first. Only then all other threads
@@ -280,6 +279,7 @@
"the wrong config file options. For instance, missing mysqld "
"binary. Aborting.");
stop_all(&guardian_thread, &thread_registry);
+ rc= 1;
goto err;
}
}
@@ -299,6 +299,7 @@
{
log_error("manager(): set_stacksize_n_create_thread(listener) failed");
stop_all(&guardian_thread, &thread_registry);
+ rc= 1;
goto err;
}
}
@@ -320,6 +321,7 @@
{
log_error("sigwait() failed");
stop_all(&guardian_thread, &thread_registry);
+ rc= 1;
goto err;
}
@@ -378,5 +380,6 @@
/* free alarm structures */
end_thr_alarm(1);
/* don't pthread_exit to kill all threads who did not shut down in time */
+ return rc;
#endif
}
--- 1.6/server-tools/instance-manager/manager.h 2006-05-22 14:22:55 +04:00
+++ 1.7/server-tools/instance-manager/manager.h 2006-11-09 20:38:01 +03:00
@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-void manager();
+int manager();
int create_pid_file(const char *pid_file_name, int pid);
--- 1.19/server-tools/instance-manager/mysqlmanager.cc 2006-05-22 15:20:37 +04:00
+++ 1.20/server-tools/instance-manager/mysqlmanager.cc 2006-11-09 20:38:01 +03:00
@@ -117,7 +117,7 @@
angel();
}
- manager();
+ return_value= manager();
#else
@@ -130,13 +130,9 @@
}
}
else
- {
- manager();
- }
+ return_value= manager();
#endif
-
- return_value= 0;
main_end:
Options::cleanup();
| Thread |
|---|
| • bk commit into 5.1 tree (petr:1.2344) BUG#21783 | Petr Chardin | 9 Nov |