Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a992833d
Commit
a992833d
authored
Jun 19, 2006
by
anozdrin@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The second fix for BUG#19391: IM fails to start after two executions.
parent
a142a4d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
16 deletions
+32
-16
server-tools/instance-manager/guardian.cc
server-tools/instance-manager/guardian.cc
+0
-3
server-tools/instance-manager/instance_map.cc
server-tools/instance-manager/instance_map.cc
+1
-1
server-tools/instance-manager/manager.cc
server-tools/instance-manager/manager.cc
+31
-12
No files found.
server-tools/instance-manager/guardian.cc
View file @
a992833d
...
...
@@ -271,10 +271,7 @@ int Guardian_thread::init()
{
if
(
!
(
instance
->
options
.
nonguarded
))
if
(
guard
(
instance
,
TRUE
))
/* do not lock guardian */
{
instance_map
->
unlock
();
return
1
;
}
}
return
0
;
...
...
server-tools/instance-manager/instance_map.cc
View file @
a992833d
...
...
@@ -215,7 +215,7 @@ int Instance_map::flush_instances()
hash_init
(
&
hash
,
default_charset_info
,
START_HASH_SIZE
,
0
,
0
,
get_instance_key
,
delete_instance
,
0
);
rc
=
load
();
guardian
->
init
();
guardian
->
init
();
// TODO: check error status.
pthread_mutex_unlock
(
&
LOCK_instance_map
);
guardian
->
unlock
();
return
rc
;
...
...
server-tools/instance-manager/manager.cc
View file @
a992833d
...
...
@@ -147,6 +147,25 @@ void manager(const Options &options)
if
(
create_pid_file
(
options
.
pid_file_name
,
manager_pid
))
return
;
/*
Initialize signals and alarm-infrastructure.
NOTE: To work nicely with LinuxThreads, the signal thread is the first
thread in the process.
NOTE:
After init_thr_alarm() call it's possible to call thr_alarm() (from
different threads), that results in sending ALARM signal to the alarm
thread (which can be the main thread). That signal can interrupt
blocking calls.
In other words, a blocking call can be interrupted in the main thread
after init_thr_alarm().
*/
sigset_t
mask
;
set_signals
(
&
mask
);
/* create guardian thread */
{
pthread_t
guardian_thd_id
;
...
...
@@ -154,9 +173,16 @@ void manager(const Options &options)
int
rc
;
/*
NOTE: Guardian should be shutdown first. Only then all other threads
need to be stopped. This should be done, as guardian is responsible for
shutting down the instances, and this is a long operation.
NOTE: Guardian should be shutdown first. Only then all other threads
need to be stopped. This should be done, as guardian is responsible
for shutting down the instances, and this is a long operation.
NOTE: Guardian uses thr_alarm() when detects current state of
instances (is_running()), but it is not interfere with
flush_instances() later in the code, because until flush_instances()
complete in the main thread, Guardian thread is not permitted to
process instances. And before flush_instances() there is no instances
to proceed.
*/
pthread_attr_init
(
&
guardian_thd_attr
);
...
...
@@ -172,10 +198,8 @@ void manager(const Options &options)
}
/*
To work nicely with LinuxThreads, the signal thread is the first thread
in the process.
*/
/* Load instances. */
int
signo
;
bool
shutdown_complete
;
...
...
@@ -189,11 +213,6 @@ void manager(const Options &options)
return
;
}
/* Initialize signals and alarm-infrastructure. */
sigset_t
mask
;
set_signals
(
&
mask
);
/* create the listener */
{
pthread_t
listener_thd_id
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment