Test suite may kill unrelated processes due to stale PID files

Bug #1096584 reported by Alexey Kopytov on 2013-01-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Fix Released
Alexey Kopytov
Fix Released
Alexey Kopytov
Fix Released
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
 if [ -f $file ]
     vlog "Found a leftover mysqld processes with PID `cat $file`, stopping it"
     kill -9 `cat $file` 2>/dev/null || true

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

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  Edit
Everyone can see this information.

Other bug subscribers