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
0b9a99db
Commit
0b9a99db
authored
Aug 30, 2004
by
tomas@poseidon.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
see resp. file
parent
7000ffde
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
3 deletions
+34
-3
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
+11
-0
ndb/src/kernel/error/ErrorHandlingMacros.hpp
ndb/src/kernel/error/ErrorHandlingMacros.hpp
+2
-0
ndb/src/kernel/main.cpp
ndb/src/kernel/main.cpp
+8
-2
ndb/src/kernel/vm/Emulator.cpp
ndb/src/kernel/vm/Emulator.cpp
+12
-1
ndb/src/kernel/vm/Emulator.hpp
ndb/src/kernel/vm/Emulator.hpp
+1
-0
No files found.
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
View file @
0b9a99db
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
// Used here only to print event reports on stdout/console.
// Used here only to print event reports on stdout/console.
EventLogger
g_eventLogger
;
EventLogger
g_eventLogger
;
extern
int
simulate_error_during_shutdown
;
Cmvmi
::
Cmvmi
(
const
Configuration
&
conf
)
:
Cmvmi
::
Cmvmi
(
const
Configuration
&
conf
)
:
SimulatedBlock
(
CMVMI
,
conf
)
SimulatedBlock
(
CMVMI
,
conf
)
...
@@ -148,6 +149,16 @@ void Cmvmi::execNDB_TAMPER(Signal* signal)
...
@@ -148,6 +149,16 @@ void Cmvmi::execNDB_TAMPER(Signal* signal)
if
(
ERROR_INSERTED
(
9997
)){
if
(
ERROR_INSERTED
(
9997
)){
ndbrequire
(
false
);
ndbrequire
(
false
);
}
}
if
(
ERROR_INSERTED
(
9996
)){
simulate_error_during_shutdown
=
SIGSEGV
;
ndbrequire
(
false
);
}
if
(
ERROR_INSERTED
(
9995
)){
simulate_error_during_shutdown
=
SIGSEGV
;
kill
(
getpid
(),
SIGABRT
);
}
}
//execNDB_TAMPER()
}
//execNDB_TAMPER()
void
Cmvmi
::
execSET_LOGLEVELORD
(
Signal
*
signal
)
void
Cmvmi
::
execSET_LOGLEVELORD
(
Signal
*
signal
)
...
...
ndb/src/kernel/error/ErrorHandlingMacros.hpp
View file @
0b9a99db
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
extern
const
char
programName
[];
extern
const
char
programName
[];
#define ERROR_SET_SIGNAL(messageCategory, messageID, problemData, objectRef) \
ErrorReporter::handleError(messageCategory, messageID, problemData, objectRef, NST_ErrorHandlerSignal)
#define ERROR_SET(messageCategory, messageID, problemData, objectRef) \
#define ERROR_SET(messageCategory, messageID, problemData, objectRef) \
ErrorReporter::handleError(messageCategory, messageID, problemData, objectRef)
ErrorReporter::handleError(messageCategory, messageID, problemData, objectRef)
// Description:
// Description:
...
...
ndb/src/kernel/main.cpp
View file @
0b9a99db
...
@@ -335,7 +335,13 @@ handler_error(int signum){
...
@@ -335,7 +335,13 @@ handler_error(int signum){
static
long
thread_id
=
0
;
static
long
thread_id
=
0
;
if
(
thread_id
!=
0
&&
thread_id
==
my_thread_id
())
if
(
thread_id
!=
0
&&
thread_id
==
my_thread_id
())
;
// Shutdown thread received signal
{
// Shutdown thread received signal
signal
(
signum
,
SIG_DFL
);
kill
(
getpid
(),
signum
);
while
(
true
)
NdbSleep_MilliSleep
(
10
);
}
if
(
theShutdownMutex
&&
NdbMutex_Trylock
(
theShutdownMutex
)
!=
0
)
if
(
theShutdownMutex
&&
NdbMutex_Trylock
(
theShutdownMutex
)
!=
0
)
while
(
true
)
while
(
true
)
NdbSleep_MilliSleep
(
10
);
NdbSleep_MilliSleep
(
10
);
...
@@ -344,5 +350,5 @@ handler_error(int signum){
...
@@ -344,5 +350,5 @@ handler_error(int 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
_SIGNAL
(
fatal
,
0
,
errorData
,
__FILE__
);
}
}
ndb/src/kernel/vm/Emulator.cpp
View file @
0b9a99db
...
@@ -61,6 +61,7 @@ Uint32 theEmulatedJamBlockNumber = 0;
...
@@ -61,6 +61,7 @@ Uint32 theEmulatedJamBlockNumber = 0;
EmulatorData
globalEmulatorData
;
EmulatorData
globalEmulatorData
;
NdbMutex
*
theShutdownMutex
=
0
;
NdbMutex
*
theShutdownMutex
=
0
;
int
simulate_error_during_shutdown
=
0
;
EmulatorData
::
EmulatorData
(){
EmulatorData
::
EmulatorData
(){
theConfiguration
=
0
;
theConfiguration
=
0
;
...
@@ -117,7 +118,8 @@ NdbShutdown(NdbShutdownType type,
...
@@ -117,7 +118,8 @@ NdbShutdown(NdbShutdownType type,
}
}
}
}
if
(
NdbMutex_Trylock
(
theShutdownMutex
)
==
0
){
if
((
type
==
NST_ErrorHandlerSignal
)
||
// Signal handler has already locked mutex
(
NdbMutex_Trylock
(
theShutdownMutex
)
==
0
)){
globalData
.
theRestartFlag
=
perform_stop
;
globalData
.
theRestartFlag
=
perform_stop
;
bool
restart
=
false
;
bool
restart
=
false
;
...
@@ -145,6 +147,9 @@ NdbShutdown(NdbShutdownType type,
...
@@ -145,6 +147,9 @@ NdbShutdown(NdbShutdownType type,
case
NST_ErrorHandler
:
case
NST_ErrorHandler
:
ndbout
<<
"Error handler "
<<
shutting
<<
" system"
<<
endl
;
ndbout
<<
"Error handler "
<<
shutting
<<
" system"
<<
endl
;
break
;
break
;
case
NST_ErrorHandlerSignal
:
ndbout
<<
"Error handler signal "
<<
shutting
<<
" system"
<<
endl
;
break
;
case
NST_Restart
:
case
NST_Restart
:
ndbout
<<
"Restarting system"
<<
endl
;
ndbout
<<
"Restarting system"
<<
endl
;
break
;
break
;
...
@@ -175,6 +180,12 @@ NdbShutdown(NdbShutdownType type,
...
@@ -175,6 +180,12 @@ NdbShutdown(NdbShutdownType type,
#endif
#endif
}
}
if
(
simulate_error_during_shutdown
)
{
kill
(
getpid
(),
simulate_error_during_shutdown
);
while
(
true
)
NdbSleep_MilliSleep
(
10
);
}
globalEmulatorData
.
theWatchDog
->
doStop
();
globalEmulatorData
.
theWatchDog
->
doStop
();
#ifdef VM_TRACE
#ifdef VM_TRACE
...
...
ndb/src/kernel/vm/Emulator.hpp
View file @
0b9a99db
...
@@ -79,6 +79,7 @@ enum NdbShutdownType {
...
@@ -79,6 +79,7 @@ enum NdbShutdownType {
NST_Normal
,
NST_Normal
,
NST_Watchdog
,
NST_Watchdog
,
NST_ErrorHandler
,
NST_ErrorHandler
,
NST_ErrorHandlerSignal
,
NST_Restart
,
NST_Restart
,
NST_ErrorInsert
NST_ErrorInsert
};
};
...
...
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