Test suite may kill unrelated processes due to stale PID files

Bug #1096584 reported by Alexey Kopytov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Fix Released
High
Alexey Kopytov
2.0
Fix Released
High
Alexey Kopytov
2.1
Fix Released
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.

Related branches

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-351

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.