Test suite may kill unrelated processes due to stale PID files

Reported by Alexey Kopytov on 2013-01-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup
High
Alexey Kopytov
2.0
High
Alexey Kopytov
2.1
High
Alexey Kopytov

Bug Description

The XtraBackup test suite may leave stale PID files when killing leftover server instances, which eventually may lead to unrelated processes getting killed later.

function kill_leftovers()
{
    local file
    for file in ${TEST_BASEDIR}/mysqld*.pid
    do
 if [ -f $file ]
 then
     vlog "Found a leftover mysqld processes with PID `cat $file`, stopping it"
     kill -9 `cat $file` 2>/dev/null || true
 fi
    done
}

PIDs are stored in $TEST_BASEDIR/mysqld<id>.pid. When a leftover server instance is killed with SIGKILL, the pid file is left in $TEST_BASEDIR. Normally the next test will overwrite the PID file. However, there may be cases when a test case starts two server instances (i.e. there are mysql1.pid and mysqld2.pid), and the next one starts only one (i.e. it only overwrites mysqld1.pid). So the next test will attempt to kill the same PID stored in mysqld2.pid once again.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers