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
7000ffde
Commit
7000ffde
authored
Aug 30, 2004
by
tomas@poseidon.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed so that error handler is only invoked once
parent
3a58d766
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
ndb/src/kernel/main.cpp
ndb/src/kernel/main.cpp
+12
-7
No files found.
ndb/src/kernel/main.cpp
View file @
7000ffde
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include <ndb_global.h>
#include <my_pthread.h>
#include <ndb_version.h>
#include <ndb_version.h>
#include "Configuration.hpp"
#include "Configuration.hpp"
...
@@ -26,6 +27,7 @@
...
@@ -26,6 +27,7 @@
#include <NdbOut.hpp>
#include <NdbOut.hpp>
#include <NdbMain.h>
#include <NdbMain.h>
#include <NdbDaemon.h>
#include <NdbDaemon.h>
#include <NdbSleep.h>
#include <NdbConfig.h>
#include <NdbConfig.h>
#include <WatchDog.hpp>
#include <WatchDog.hpp>
...
@@ -39,6 +41,7 @@
...
@@ -39,6 +41,7 @@
#endif
#endif
extern
EventLogger
g_eventLogger
;
extern
EventLogger
g_eventLogger
;
extern
NdbMutex
*
theShutdownMutex
;
void
catchsigs
(
bool
ignore
);
// for process signal handling
void
catchsigs
(
bool
ignore
);
// for process signal handling
...
@@ -328,16 +331,18 @@ handler_shutdown(int signum){
...
@@ -328,16 +331,18 @@ handler_shutdown(int signum){
extern
"C"
extern
"C"
void
void
handler_error
(
int
signum
){
handler_error
(
int
signum
){
// only let one thread run shutdown
static
long
thread_id
=
0
;
if
(
thread_id
!=
0
&&
thread_id
==
my_thread_id
())
;
// Shutdown thread received signal
if
(
theShutdownMutex
&&
NdbMutex_Trylock
(
theShutdownMutex
)
!=
0
)
while
(
true
)
NdbSleep_MilliSleep
(
10
);
thread_id
=
my_thread_id
();
g_eventLogger
.
info
(
"Received signal %d. Running error handler."
,
signum
);
g_eventLogger
.
info
(
"Received signal %d. Running error handler."
,
signum
);
// restart the system
// restart the system
char
errorData
[
40
];
char
errorData
[
40
];
snprintf
(
errorData
,
40
,
"Signal %d received"
,
signum
);
snprintf
(
errorData
,
40
,
"Signal %d received"
,
signum
);
ERROR_SET
(
fatal
,
0
,
errorData
,
__FILE__
);
ERROR_SET
(
fatal
,
0
,
errorData
,
__FILE__
);
}
}
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