py3 comparison troubles

Bug #1900770 reported by Tim Burke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
High
Unassigned

Bug Description

I think this came in with waterfall-ec:

ERROR Unhandled exception in request:
Traceback (most recent call last):
  File "/vagrant/swift/swift/proxy/server.py", line 586, in handle_request
    return handler(req)
  File "/vagrant/swift/swift/proxy/controllers/base.py", line 292, in wrapped
    return func(*a, **kw)
  File "/vagrant/swift/swift/proxy/controllers/obj.py", line 268, in GET
    return self.GETorHEAD(req)
  File "/vagrant/swift/swift/proxy/controllers/obj.py", line 256, in GETorHEAD
    resp = self._get_or_head_response(req, node_iter, partition, policy)
  File "/vagrant/swift/swift/proxy/controllers/obj.py", line 2953, in _get_or_head_response
    best_bucket = buckets.best_bucket
  File "/vagrant/swift/swift/proxy/controllers/obj.py", line 2241, in best_bucket
    return self.least_bad_bucket
  File "/vagrant/swift/swift/proxy/controllers/obj.py", line 2259, in least_bad_bucket
    short, status = min((bucket.shortfall, status)
TypeError: '<' not supported between instances of 'int' and 'NoneType'

I think it's just a matter of using 0 or something around https://github.com/openstack/swift/blob/2.26.0/swift/proxy/controllers/obj.py#L2121 ? There may be some other repercussions to that though :-/

Revision history for this message
clayg (clay-gerrard) wrote :
Changed in swift:
importance: Undecided → High
Changed in swift:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/swift 2.27.0

This issue was fixed in the openstack/swift 2.27.0 release.

Revision history for this message
Tim Burke (1-tim-z) wrote :

Fixed in https://review.opendev.org/c/openstack/swift/+/759075:

  py3: Fix status comparison in ECGetResponseCollection

  The initial dummy bad bucket was previously stored using None as a
  key. In some circumstances this None key might be compared with
  integer response status, which is unsupported in py3.

  Move away from having any sort of default value and instead return a
  default dummy bucket if we don't have any responses or only have 404
  responses.

  Co-Authored-By: Alistair Coles <email address hidden>
  Change-Id: I6a2ec3739ac92affb0f3dac248f26a1fc4ac9493
  Closes-Bug: #1900770

Backported to victoria in https://review.opendev.org/c/openstack/swift/+/770968

Changed in swift:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/swift victoria-eom

This issue was fixed in the openstack/swift victoria-eom release.

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.