Skip to content

Conversation

@almostimplemented
Copy link

Addresses bug #180 encountered when running Graphite in Python 3.

@brutasse
Copy link
Owner

Would it be possible to add a regression test? I'm not sure which conditions triggers this issue.

@almostimplemented
Copy link
Author

Sure, added.

The condition to trigger is when the operands of the compare in bisect.bisect_left (specifically: if a[mid] < x: lo = mid+1) agree on the first value of the tuple, thus requiring a comparison of the next entry. In the current code, that entry is None, which is no longer a supported operand for comparison in Python3.

("127.0.0.1",None)
]
carbonlink = ConsistentHashRing(hosts)
node = carbonlink.get_node('hosts.worker44.cpu')
Copy link
Author

@almostimplemented almostimplemented Nov 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, it looks like this passed the automated test... I arrived upon this value by iterating through metric values (e.g. for x in range(100): ... 'hosts.worker%s.cpu' % x ... ). This was the first value triggering the raised bisect exception.

@RincewindsHat
Copy link

This seems to work for me.
To make this better findable, this is the error message I got :

TypeError: '<' not supported between instances of 'tuple' and 'NoneType'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants