diff options
author | Tim Burke <tim.burke@gmail.com> | 2018-04-10 17:04:56 -0700 |
---|---|---|
committer | Tim Burke <tim.burke@gmail.com> | 2018-04-10 17:09:07 -0700 |
commit | 5b68eb5396edc33a64c6012a333c72d5a5878a64 (patch) | |
tree | afe43e9a3da117e4b9f804cf0b8d3113fb3180f6 /bin | |
parent | bbf5e5c7f3fd46f6474301beaf3885a61e423379 (diff) | |
download | swift-5b68eb5396edc33a64c6012a333c72d5a5878a64.tar.gz |
swift-(account|container)-info: tolerate LockTimeouts
I'm not really clear on why a sqlite3.OperationalError should cause us to
retry with stale_reads_ok=True, but swift.common.exceptions.LockTimeout
*definitely* should.
Change-Id: I707dec1d11b8db80bc8fbee30662b319bf10d6a5
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/swift-account-info | 3 | ||||
-rwxr-xr-x | bin/swift-container-info | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/bin/swift-account-info b/bin/swift-account-info index 554f5e009..e9ae188dc 100755 --- a/bin/swift-account-info +++ b/bin/swift-account-info @@ -16,6 +16,7 @@ import sys from optparse import OptionParser from swift.cli.info import print_info, InfoSystemExit +from swift.common.exceptions import LockTimeout def run_print_info(args, opts): @@ -23,7 +24,7 @@ def run_print_info(args, opts): print_info('account', *args, **opts) except InfoSystemExit: sys.exit(1) - except sqlite3.OperationalError as e: + except (sqlite3.OperationalError, LockTimeout) as e: if not opts.get('stale_reads_ok'): opts['stale_reads_ok'] = True print('Warning: Possibly Stale Data') diff --git a/bin/swift-container-info b/bin/swift-container-info index 136e48919..cbb10b6ec 100755 --- a/bin/swift-container-info +++ b/bin/swift-container-info @@ -16,6 +16,7 @@ import sys from optparse import OptionParser from swift.cli.info import print_info, InfoSystemExit +from swift.common.exceptions import LockTimeout def run_print_info(args, opts): @@ -23,7 +24,7 @@ def run_print_info(args, opts): print_info('container', *args, **opts) except InfoSystemExit: sys.exit(1) - except sqlite3.OperationalError as e: + except (sqlite3.OperationalError, LockTimeout) as e: if not opts.get('stale_reads_ok'): opts['stale_reads_ok'] = True print('Warning: Possibly Stale Data') |