]> git.ipfire.org Git - thirdparty/libvirt.git/commit
sanlock: Retry after EINPROGRESS
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 15 Nov 2012 10:19:08 +0000 (11:19 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 16 Nov 2012 07:00:11 +0000 (08:00 +0100)
commit96a02703daad4dc6663165adbc0feade9900cebd
treeb48b8aec5ca26ce99b69595d917c8594d6d4ee82
parent58110b48870b4e8efd1d833e3ecbef41b62d1877
sanlock: Retry after EINPROGRESS

It may take some time for sanlock to add a lockspace. And if user
restart libvirtd service meanwhile, the fresh daemon can fail adding
the same lockspace with EINPROGRESS. Recent sanlock has
sanlock_inq_lockspace() function which should block until lockspace
changes state. If we are building against older sanlock we should
retry a few times before claiming an error. This issue can be easily
reproduced:

for i in {1..1000} ; do echo $i; service libvirtd restart; sleep 2; done
20
Stopping libvirtd daemon:                                  [FAILED]
Starting libvirtd daemon:                                  [  OK  ]
21
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
22
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]

 error : virLockManagerSanlockSetupLockspace:334 : Unable to add
 lockspace /var/lib/libvirt/sanlock/__LIBVIRT__DISKS__: Operation now in
 progress
configure.ac
src/locking/lock_driver_sanlock.c