summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-09-14 13:01:24 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2018-09-17 15:34:24 -0400
commit9f634fbb3b49e1a591f054b097caf862f192f0c2 (patch)
treebbb630f9dcd808af89af83cfd5900df123de9275
parent6a997282e7cc62b5415e46e2bf2eb39a34322c94 (diff)
downloadmongo-9f634fbb3b49e1a591f054b097caf862f192f0c2.tar.gz
SERVER-36842 Core dump not generated after invariant failure in powercycle hosts
-rw-r--r--etc/evergreen.yml58
1 files changed, 58 insertions, 0 deletions
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index 83ed45648bc..0c1ef8fcd40 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -2303,6 +2303,64 @@ functions:
shell: bash
working_dir: src
script: |
+ if [ "Windows_NT" = "$OS" ]; then
+ exit 0
+ fi
+ # Enable core dumps on non-Windows remote hosts.
+ # The core pattern must specify a director, since mongod --fork will chdir("/")
+ # and cannot generate a core dump there (see SERVER-21635).
+ # We need to reboot the host for the core limits to take effect.
+ ${set_sudo}
+ core_pattern=${remote_dir}/dump_%e.%p.core
+ sysctl_conf=/etc/sysctl.conf
+ cmds="ulimit -a"
+ cmds="$cmds; echo \"$USER - core unlimited\" | $sudo tee -a /etc/security/limits.conf"
+ cmds="$cmds; if [ -f $sysctl_conf ]"
+ cmds="$cmds; then grep ^kernel.core_pattern $sysctl_conf"
+ cmds="$cmds; if [ \$? -eq 0 ]"
+ cmds="$cmds; then $sudo sed -i \"s,kernel.core_pattern=.*,kernel.core_pattern=$core_pattern,\" $sysctl_conf"
+ cmds="$cmds; else echo \"kernel.core_pattern=$core_pattern\" | $sudo tee -a $sysctl_conf"
+ cmds="$cmds; fi"
+ cmds="$cmds; else echo Cannot change the core pattern and no core dumps will be generated."
+ cmds="$cmds; fi"
+ cmds="$cmds; $sudo reboot"
+ ssh_connection_options="${ssh_identity} ${ssh_connection_options}"
+ ${activate_virtualenv}
+ $python buildscripts/remote_operations.py \
+ --verbose \
+ --userHost $USER@${private_ip_address} \
+ --sshConnectionOptions "$ssh_connection_options" \
+ --retries ${ssh_retries|0} \
+ --commands "$cmds"
+
+ - command: shell.exec
+ params:
+ shell: bash
+ working_dir: src
+ script: |
+ if [ "Windows_NT" = "$OS" ]; then
+ exit 0
+ fi
+ # Print the ulimit & kernel.core_pattern
+ cmds="uptime"
+ cmds="$cmds; ulimit -a"
+ cmds="$cmds; if [ -f /sbin/sysctl ]"
+ cmds="$cmds; then /sbin/sysctl kernel.core_pattern"
+ cmds="$cmds; fi"
+ ssh_connection_options="${ssh_identity} ${ssh_connection_options}"
+ ${activate_virtualenv}
+ $python buildscripts/remote_operations.py \
+ --verbose \
+ --userHost $USER@${private_ip_address} \
+ --sshConnectionOptions "$ssh_connection_options" \
+ --retries ${ssh_retries|3} \
+ --commands "$cmds"
+
+ - command: shell.exec
+ params:
+ shell: bash
+ working_dir: src
+ script: |
set -o errexit
${set_sudo}
# Set up curator to collect system & process stats on remote.