summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Page <charlie.page@mongodb.com>2013-12-31 17:41:09 -0500
committerDan Pasette <dan@mongodb.com>2014-03-09 11:27:35 -0400
commita7d9059a07c1be3043dae0dcfbabfa0e5a908f9e (patch)
tree41e82cb84802483f10c3c6ce26de42f6e659798d
parent2c62563720d16b49abe24cbb799b70e5b00ed169 (diff)
downloadmongo-a7d9059a07c1be3043dae0dcfbabfa0e5a908f9e.tar.gz
SERVER-12034 Fix bug with SIGXCPU causing a core dump in mongoD/mongoS.
Graceful shutdown was chosen so we can log the signal; There is no risk of data corruption. Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
-rw-r--r--src/mongo/db/db.cpp1
-rw-r--r--src/mongo/s/server.cpp3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index 29d470f39e0..c04d2afb1e1 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -1438,6 +1438,7 @@ namespace mongo {
sigaddset( &asyncSignals, SIGINT );
sigaddset( &asyncSignals, SIGTERM );
sigaddset( &asyncSignals, SIGUSR1 );
+ sigaddset( &asyncSignals, SIGXCPU );
set_terminate( myterminate );
set_new_handler( my_new_handler );
diff --git a/src/mongo/s/server.cpp b/src/mongo/s/server.cpp
index e6aa728d7a3..5bcfe291519 100644
--- a/src/mongo/s/server.cpp
+++ b/src/mongo/s/server.cpp
@@ -197,6 +197,9 @@ namespace mongo {
signal(SIGTERM, sighandler);
signal(SIGINT, sighandler);
+#if defined(SIGXCPU)
+ signal(SIGXCPU, sighandler);
+#endif
#if defined(SIGQUIT)
signal( SIGQUIT , printStackAndExit );