Skip to content

Commit

Permalink
- give up on getting a useful stack trace and instead optimize for sh…
Browse files Browse the repository at this point in the history
…orter downtime during cooties
  • Loading branch information
BenLubar committed Jul 27, 2016
1 parent 5b73b5f commit 3921638
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
@@ -1,4 +1,4 @@
FROM boomzillawtf/tdwtf:node-gdbjit
FROM node:4

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
Expand Down Expand Up @@ -45,4 +45,4 @@ RUN ln -s /usr/src/app/docker/config.json /usr/src/app/config.json
CMD cat .make-uploads-folders | xargs mkdir -p \
&& ./nodebb upgrade \
&& echo 1 > pidfile \
&& exec node --gdbjit loader.js
&& exec node loader.js
9 changes: 8 additions & 1 deletion watchdog.bash
@@ -1,15 +1,22 @@
#!/bin/bash

start_time=$(date -u +%s)

until curl -fsm 5 http://127.0.0.1:"$1"/recent.rss > /dev/null; do
echo "Waiting for $PPID/$1"
sleep 5
done

start_time=$(( $(date -u +%s) - $start_time ))

echo "$PPID/$1 up after $start_time seconds"

while true; do
if ! curl -fsm 15 http://127.0.0.1:"$1"/recent.rss > /dev/null; then
echo "$PPID/$1 timed out"
date -uIns
gdb -p "$PPID" -ex 'thread apply all bt' -ex 'kill' --batch
#gdb -p "$PPID" -ex 'thread apply all bt' -ex 'kill' --batch
kill -9 "$PPID"
exit
fi
sleep 5
Expand Down

0 comments on commit 3921638

Please sign in to comment.