]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
tests: prevent kill race condition
authorLoic Dachary <loic@dachary.org>
Fri, 13 Jun 2014 12:41:39 +0000 (14:41 +0200)
committerLoic Dachary <ldachary@redhat.com>
Mon, 22 Dec 2014 21:54:20 +0000 (22:54 +0100)
commit754363f4563e7dbda1ef23fadc8d6ef1a3fdd0af
tree298291f90409a3e49a5fa4332b1ed9600179c498
parent5be6f2f60e3225bf3d214432044721fe474d55d7
tests: prevent kill race condition

When trying to kill a daemon, keep its pid in a variable instead of
retrieving it from the pidfile multiple times. It prevents the following
race condition:

  * try to kill ceph-mon
  * ceph-mon is in the process of dying and removed its pidfile
  * try to kill ceph-mon fails because the pidfile is not found
  * another ceph-mon is spawned and fails to bind the port
    because the previous ceph-mon is still holding it

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit a1c13c57ba20fc329d943ea57523913e11067dc7)
src/test/ceph-disk.sh
src/test/mon/mkfs.sh
src/test/mon/mon-test-helpers.sh