diff options
| author | Stanislaw Pitucha <stanislaw.pitucha@hp.com> | 2012-08-02 13:51:07 +0100 |
|---|---|---|
| committer | Stanislaw Pitucha <stanislaw.pitucha@hp.com> | 2012-08-04 12:52:50 +0100 |
| commit | 2c1524866acb9f9ac3f50dc7d33338cfb03fd08a (patch) | |
| tree | 61e6f7b8e42ae54fec324c34b000b77244fcceb2 /tools | |
| parent | 245e9400402207588e31ba249c2c13be28f0ff63 (diff) | |
| download | nova-2c1524866acb9f9ac3f50dc7d33338cfb03fd08a.tar.gz nova-2c1524866acb9f9ac3f50dc7d33338cfb03fd08a.tar.xz nova-2c1524866acb9f9ac3f50dc7d33338cfb03fd08a.zip | |
Improve external lock implementation
Remove a number of limitations from the external locks.
- They can be nested now
- They do not need external cleanup in case of failures
- They do not rely on lockfile or greenlet internal implementation
New implementation is based on fcntl locks and any crashing process
will drop the lock. It does not have to rely on any cleanup code or
handling exceptions. Because no cleanup is needed, a number of tests
have been removed.
This implementation is not portable outside of POSIX/BSD/SVR4 systems.
Fcntl locks should work correctly with NFS mounts.
Locks are cleaned up after the tests finish running via run_tests.sh,
even though it's not strictly needed.
This change requires eventlet >= 0.9.17.
bp improve-external-locking
Change-Id: Idf5424c04645f25097733848a007b150145b0b27
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/clean_file_locks.py | 63 | ||||
| -rw-r--r-- | tools/pip-requires | 1 |
2 files changed, 0 insertions, 64 deletions
diff --git a/tools/clean_file_locks.py b/tools/clean_file_locks.py deleted file mode 100755 index 39b7d695b..000000000 --- a/tools/clean_file_locks.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2012 La Honda Research Center, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""clean_file_locks.py - Cleans stale interprocess locks - -This rountine can be used to find and delete stale lock files from -nova's interprocess synchroization. It can be used safely while services -are running. - -""" - -import logging -import optparse - -from nova import flags -from nova.openstack.common import log -from nova import utils - - -LOG = log.getLogger('nova.utils') -FLAGS = flags.FLAGS - - -def parse_options(): - """process command line options.""" - - parser = optparse.OptionParser('usage: %prog [options]') - parser.add_option('--verbose', action='store_true', - help='List lock files found and deleted') - - options, args = parser.parse_args() - - return options, args - - -def main(): - """Main loop.""" - options, args = parse_options() - verbose = options.verbose - - if verbose: - LOG.logger.setLevel(logging.DEBUG) - else: - LOG.logger.setLevel(logging.INFO) - LOG.info('Cleaning stale locks from %s' % FLAGS.lock_path) - utils.cleanup_file_locks() - LOG.info('Finished') - -if __name__ == '__main__': - main() diff --git a/tools/pip-requires b/tools/pip-requires index 7c8843093..5fa96a4cf 100644 --- a/tools/pip-requires +++ b/tools/pip-requires @@ -5,7 +5,6 @@ anyjson==0.2.4 boto==2.1.1 eventlet>=0.9.17 kombu==1.0.4 -lockfile==0.8 lxml==2.3 python-daemon==1.5.5 routes==1.12.3 |
