Skip to content

v0.7.0

Latest

Choose a tag to compare

@jpmelos jpmelos released this 27 Oct 04:55
· 4 commits to master since this release
v0.7.0
9844925

Breaking changes:

  • GeventRingNode is gone (#39).
    • Use RingNode instead. In a process that runs gevent.monkey.patch_all(), RingNode runs its loop in a greenlet.
  • RingNode.poll() is private (#41).
    • Use RingNode.start() and RingNode.stop() instead.
  • RingNode.start() returns only when the node is in the ring and has its ranges (#41).
  • If Redis does not confirm the subscription to the ring channel in 10 seconds, start() raises redis.exceptions.TimeoutError.
  • RingNode.start() raises RuntimeError if the node already started (#41).
  • RingNode.start() and RingNode.stop() raise RuntimeError if another start() or stop() call on the same node is in progress (#41).
  • RingNode.get_ranges() returns a tuple instead of a list (#40).
  • The timing constants have new names (#41):
    • POLL_INTERVAL is now POLL_INTERVAL_SECONDS.
    • NODE_TIMEOUT is now NODE_TIMEOUT_SECONDS.
    • CLEANUP_INTERVAL is now CLEANUP_INTERVAL_SECONDS.

New features:

  • HashAlgorithm.ring_point(key) returns the point of a key on the ring. It does not need a RingNode (#49).
  • The thread of a node has the name redis-hashring-<key> (#41).

Bug fixes:

  • contains(), get_ranges(), and get_node_count() give correct results while another thread updates the ring. Before, they could see empty or partial ranges. Then contains() returned False for keys that the node owns (#40).
  • Two update() calls at the same time no longer lose ranges or keep an older ring (#40).
  • After remove(), the node owns no keys, even if Redis fails during the removal (#40).
  • contains() gives correct results right after start() returns. Before, it returned False for all keys until the first pass of the polling loop (#41).
  • At startup, the node waits for Redis to confirm the subscription to the ring channel before it reads the ring. Thus, the node does not miss changes of the ring during startup (#41).
  • stop() no longer waits forever if the thread of the node fails during its first Redis calls (#41).
  • A node no longer leaks file descriptors when its thread fails (#41).