OverflowError and MemoryError when --segment-threads param is out of range

Bug #1453130 reported by Inessa Vasilevskaya
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-swiftclient
New
Undecided
Unassigned

Bug Description

The issue can be reproduced on devstack (kilo).

I don't believe it's a serious issue, but as long as the command fails the output could be nicer :)

ina@ubuntu:~/devstack$ swift --os-username service:glance-swift --os-password SOMEPASS upload glance worlddump-2015-01-19-143737.txt --segment-threads 4242424242
Traceback (most recent call last):
  File "/usr/local/bin/swift", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/shell.py", line 1287, in main
    globals()['st_%s' % args[0]](parser, argv[1:], output)
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/shell.py", line 746, in st_upload
    with SwiftService(options=_opts) as swift:
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/service.py", line 376, in __init__
    container_threads=self._options['container_threads']
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/multithreading.py", line 122, in __init__
    create_connection, max_workers=segment_threads)
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/multithreading.py", line 155, in __init__
    for p in range(0, max_workers):
MemoryError

ina@ubuntu:~/devstack$ swift --os-username service:glance-swift --os-password SOMEPASS upload glance worlddump-2015-01-19-143737.txt --segment-threads 424242424242424242424242
Traceback (most recent call last):
  File "/usr/local/bin/swift", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/shell.py", line 1287, in main
    globals()['st_%s' % args[0]](parser, argv[1:], output)
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/shell.py", line 746, in st_upload
    with SwiftService(options=_opts) as swift:
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/service.py", line 376, in __init__
    container_threads=self._options['container_threads']
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/multithreading.py", line 122, in __init__
    create_connection, max_workers=segment_threads)
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/multithreading.py", line 155, in __init__
    for p in range(0, max_workers):
OverflowError: range() result has too many items

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.