[ 
https://issues.apache.org/jira/browse/MESOS-1559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14065775#comment-14065775
 ] 

Yan Xu commented on MESOS-1559:
-------------------------------

Use something like this on Jenkins. This can be generalized and put in Mesos 
./support folder.

{code}
cmd="MESOS_VERBOSE=1 GLOG_v=1 make check GTEST_SHUFFLE=1"

start=$(date +"%s")
$cmd &

pid=$!

duration=$((160 * 60))

while [ $(($(date +"%s") - $start)) -lt $duration ]; do
  running=`jobs | grep "Running" | wc -l`
  if [ $running -eq 0 ]; then exit 0; fi
  sleep 10
done

echo "Process still running after $duration seconds. Attaching gdb..."

tmp=`mktemp -t XXXXX`
echo "thread apply all bt" > $tmp; gdb attach $pid < $tmp

echo "Killing the process"

kill $pid
{code}

> Allow jenkins build machine to dump stack traces of all threads when timeout
> ----------------------------------------------------------------------------
>
>                 Key: MESOS-1559
>                 URL: https://issues.apache.org/jira/browse/MESOS-1559
>             Project: Mesos
>          Issue Type: Improvement
>          Components: build, jenkins
>            Reporter: Jie Yu
>            Assignee: Yan Xu
>            Priority: Minor
>
> Many of the time, when jenkins build times out, we know that some test 
> freezes at some place. However, most of the time, it's very hard to reproduce 
> the deadlock on dev machines.
> I would be cool if we can dump the stack traces of all threads when jenkins 
> build times out. Some command like the following:
> {noformat}
> echo thread apply all bt > tmp; gdb attach `pgrep lt-mesos-tests` < tmp
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to