CHANGES.rst 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. Changelog
  2. =========
  3. 2.0 (2014-06-19)
  4. ----------------
  5. Documentation
  6. *************
  7. - Extend support to Python 3.4, deprecating Python 3.2.
  8. - Issue #198: Mention Zake as a sophisticated kazoo mock testing library.
  9. - Issue #181: Add documentation on basic logging setup.
  10. 2.0b1 (2014-04-24)
  11. ------------------
  12. API Changes
  13. ***********
  14. - Null or None data is no longer treated as "". Pull req #165, patch by
  15. Raul Gutierrez S. This will affect how you should treat null data in a
  16. znode vs. an empty string.
  17. - Passing acl=[] to create() now works properly instead of an InvalidACLError
  18. as it returned before. Patch by Raul Gutierrez S in PR #164.
  19. - Removed the dependency on zope.interface. The classes in the interfaces
  20. module are left for documentation purposes only (issue #131).
  21. Features
  22. ********
  23. - Logging levels have been reduced.
  24. - Logging previously at the ``logging.DEBUG`` level is now logged at
  25. the ``kazoo.loggingsupport.BLATHER`` level (5).
  26. - Some low-level logging previously at the ``logging.INFO`` level is
  27. now logged at the ``logging.DEBUG`` level.
  28. - Issue #133: Introduce a new environment variable `ZOOKEEPER_PORT_OFFSET`
  29. for the testing support, to run the testing cluster on a different range.
  30. Bug Handling
  31. ************
  32. - When authenticating via add_auth() the auth data will be saved to ensure that
  33. the authentication happens on reconnect (as is the case when feeding auth
  34. data via KazooClient's constructor). PR #172, patch by Raul Gutierrez S.
  35. - Change gevent import to remove deprecation warning when newer gevent is
  36. used. PR #191, patch by Hiroaki Kawai.
  37. - Lock recipe was failing to use the client's sleep_func causing issues with
  38. gevent. Issue #150.
  39. - Calling a DataWatch or ChildrenWatch instance twice (decorator) now throws
  40. an exception as only a single function can be associated with a single
  41. watcher. Issue #154.
  42. - Another fix for atexit handling so that when disposing of connections the
  43. atexit handler is removed. PR #190, patch by Devaev Maxim.
  44. - Fix atexit handling for kazoo threading handler, PR #183. Patch by
  45. Brian Wickman.
  46. - Partitioner should handle a suspended connection properly and restore
  47. an allocated state if it was allocated previously. Patch by Manish Tomar.
  48. - Issue #167: Closing a client that was never started throws a type error.
  49. Patch by Joshua Harlow.
  50. - Passing dictionaries to KazooClient.__init__() wasn't actually working
  51. properly. Patch by Ryan Uber.
  52. - Issue #119: Handler timeout takes the max of the random interval or
  53. the read timeout to ensure a negative number isn't used for the read
  54. timeout.
  55. - Fix ordering of exception catches in lock.acquire as it was capturing a
  56. parent exception before the child. Patch by ReneSac.
  57. - Fix issue with client.stop() not always setting the client state to
  58. KeeperState.CLOSED. Patch by Jyrki Pulliainen in PR #174.
  59. - Issue #169: Fixed pipes leaking into child processes.
  60. Documentation
  61. *************
  62. - Add section on contributing recipes, add maintainer/status information for
  63. existing recipes.
  64. - Add note about alternate use of DataWatch.
  65. 1.3.1 (2013-09-25)
  66. ------------------
  67. Bug Handling
  68. ************
  69. - #118, #125, #128: Fix unknown variable in KazooClient `command_retry`
  70. argument handling.
  71. - #126: Fix `KazooRetry.copy` to correctly copy sleep function.
  72. - #118: Correct session/socket timeout conversion (int vs. float).
  73. Documentation
  74. *************
  75. - #121: Add a note about `kazoo.recipe.queue.LockingQueue` requiring a
  76. Zookeeper 3.4+ server.
  77. 1.3 (2013-09-05)
  78. ----------------
  79. Features
  80. ********
  81. - #115: Limit the backends we use for SLF4J during tests.
  82. - #112: Add IPv6 support. Patch by Dan Kruchinin.
  83. 1.2.1 (2013-08-01)
  84. ------------------
  85. Bug Handling
  86. ************
  87. - Issue #108: Circular import fail when importing kazoo.recipe.watchers
  88. directly has now been resolved. Watchers and partitioner properly import
  89. the KazooState from kazoo.protocol.states rather than kazoo.client.
  90. - Issue #109: Partials not usable properly as a datawatch call can now be
  91. used. All funcs will be called with 3 args and fall back to 2 args if
  92. there's an argument error.
  93. - Issue #106, #107: `client.create_async` didn't strip change root from the
  94. returned path.
  95. 1.2 (2013-07-24)
  96. ----------------
  97. Features
  98. ********
  99. - KazooClient can now be stopped more reliably even if its in the middle
  100. of a long retry sleep. This utilizes the new interrupt feature of
  101. KazooRetry which lets the sleep be broken down into chunks and an
  102. interrupt function called to determine if the retry should fail early.
  103. - Issue #62, #92, #89, #101, #102: Allow KazooRetry to have a
  104. max deadline, transition properly when connection fails to LOST, and
  105. setup separate connection retry behavior from client command retry
  106. behavior. Patches by Mike Lundy.
  107. - Issue #100: Make it easier to see exception context in threading and
  108. connection modules.
  109. - Issue #85: Increase information density of logs and don't prevent
  110. dynamic reconfiguration of log levels at runtime.
  111. - Data-watchers for the same node are no longer 'stacked'. That is, if
  112. a get and an exists call occur for the same node with the same watch
  113. function, then it will be registered only once. This change results in
  114. Kazoo behaving per Zookeeper client spec regarding repeat watch use.
  115. Bug Handling
  116. ************
  117. - Issue #53: Throw a warning upon starting if the chroot path doesn't exist
  118. so that it's more obvious when the chroot should be created before
  119. performing more operations.
  120. - Kazoo previously would let the same function be registered as a data-watch
  121. or child-watch multiple times, and then call it multiple times upon being
  122. triggered. This was non-compliant Zookeeper client behavior, the same
  123. watch can now only be registered once for the same znode path per Zookeeper
  124. client documentation.
  125. - Issue #105: Avoid rare import lock problems by moving module imports in
  126. client.py to the module scope.
  127. - Issue #103: Allow prefix-less sequential znodes.
  128. - Issue #98: Extend testing ZK harness to work with different file locations
  129. on some versions of Debian/Ubuntu.
  130. - Issue #97: Update some docstrings to reflect current state of handlers.
  131. - Issue #62, #92, #89, #101, #102: Allow KazooRetry to have a
  132. max deadline, transition properly when connection fails to LOST, and
  133. setup separate connection retry behavior from client command retry
  134. behavior. Patches by Mike Lundy.
  135. API Changes
  136. ***********
  137. - The `kazoo.testing.harness.KazooTestHarness` class directly inherits from
  138. `unittest.TestCase` and you need to ensure to call its `__init__` method.
  139. - DataWatch no longer takes any parameters besides for the optional function
  140. during instantiation. The additional options are now implicitly True, with
  141. the user being left to ignore events as they choose. See the DataWatch
  142. API docs for more information.
  143. - Issue #99: Better exception raised when the writer fails to close. A
  144. WriterNotClosedException that inherits from KazooException is now raised
  145. when the writer fails to close in time.
  146. 1.1 (2013-06-08)
  147. ----------------
  148. Features
  149. ********
  150. - Issue #93: Add timeout option to lock/semaphore acquire methods.
  151. - Issue #79 / #90: Add ability to pass the WatchedEvent to DataWatch and
  152. ChildWatch functions.
  153. - Respect large client timeout values when closing the connection.
  154. - Add a `max_leases` consistency check to the semaphore recipe.
  155. - Issue #76: Extend testing helpers to allow customization of the Java
  156. classpath by specifying the new `ZOOKEEPER_CLASSPATH` environment variable.
  157. - Issue #65: Allow non-blocking semaphore acquisition.
  158. Bug Handling
  159. ************
  160. - Issue #96: Provide Windows compatibility in testing harness.
  161. - Issue #95: Handle errors deserializing connection response.
  162. - Issue #94: Clean up stray bytes in connection pipe.
  163. - Issue #87 / #88: Allow re-acquiring lock after cancel.
  164. - Issue #77: Use timeout in initial socket connection.
  165. - Issue #69: Only ensure path once in lock and semaphore recipes.
  166. - Issue #68: Closing the connection causes exceptions to be raised by watchers
  167. which assume the connection won't be closed when running commands.
  168. - Issue #66: Require ping reply before sending another ping, otherwise the
  169. connection will be considered dead and a ConnectionDropped will be raised
  170. to trigger a reconnect.
  171. - Issue #63: Watchers weren't reset on lost connection.
  172. - Issue #58: DataWatcher failed to re-register for changes after non-existent
  173. node was created then deleted.
  174. API Changes
  175. ***********
  176. - KazooClient.create_async now supports the makepath argument.
  177. - KazooClient.ensure_path now has an async version, ensure_path_async.
  178. 1.0 (2013-03-26)
  179. ----------------
  180. Features
  181. ********
  182. - Added a LockingQueue recipe. The queue first locks an item and removes it
  183. from the queue only after the consume() method is called. This enables other
  184. nodes to retake the item if an error occurs on the first node.
  185. Bug Handling
  186. ************
  187. - Issue #50: Avoid problems with sleep function in mixed gevent/threading
  188. setup.
  189. - Issue #56: Avoid issues with watch callbacks evaluating to false.
  190. 1.0b1 (2013-02-24)
  191. ------------------
  192. Features
  193. ********
  194. - Refactored the internal connection handler to use a single thread. It now
  195. uses a deque and pipe to signal the ZK thread that there's a new command to
  196. send, so that the ZK thread can send it, or retrieve a response.
  197. Processing ZK requests and responses serially in a single thread eliminates
  198. the need for a bunch of the locking, the peekable queue and two threads
  199. working on the same underlying socket.
  200. - Issue #48: Added documentation for the `retry` helper module.
  201. - Issue #55: Fix `os.pipe` file descriptor leak and introduce a
  202. `KazooClient.close` method. The method is particular useful in tests, where
  203. multiple KazooClients are created and closed in the same process.
  204. Bug Handling
  205. ************
  206. - Issue #46: Avoid TypeError in GeneratorContextManager on process shutdown.
  207. - Issue #43: Let DataWatch return node data if allow_missing_node is used.
  208. 0.9 (2013-01-07)
  209. ----------------
  210. API Changes
  211. ***********
  212. - When a retry operation ultimately fails, it now raises a
  213. `kazoo.retry.RetryFailedError` exception, instead of a general `Exception`
  214. instance. `RetryFailedError` also inherits from the base `KazooException`.
  215. Features
  216. ********
  217. - Improvements to Debian packaging rules.
  218. Bug Handling
  219. ************
  220. - Issue #39 / #41: Handle connection dropped errors during session writes.
  221. Ensure client connection is re-established to a new ZK node if available.
  222. - Issue #38: Set `CLOEXEC` flag on all sockets when available.
  223. - Issue #37 / #40: Handle timeout errors during `select` calls on sockets.
  224. - Issue #36: Correctly set `ConnectionHandler.writer_stopped` even if an
  225. exception is raised inside the writer, like a retry operation failing.
  226. 0.8 (2012-10-26)
  227. ----------------
  228. API Changes
  229. ***********
  230. - The `KazooClient.__init__` took as `watcher` argument as its second keyword
  231. argument. The argument had no effect anymore since version 0.5 and was
  232. removed.
  233. Bug Handling
  234. ************
  235. - Issue #35: `KazooClient.__init__` didn't pass on `retry_max_delay` to the
  236. retry helper.
  237. - Issue #34: Be more careful while handling socket connection errors.
  238. 0.7 (2012-10-15)
  239. ----------------
  240. Features
  241. ********
  242. - DataWatch now has a `allow_missing_node` setting that allows a watch to be
  243. set on a node that doesn't exist when the DataWatch is created.
  244. - Add new Queue recipe, with optional priority support.
  245. - Add new Counter recipe.
  246. - Added debian packaging rules.
  247. Bug Handling
  248. ************
  249. - Issue #31 fixed: Only catch KazooExceptions in catch-all calls.
  250. - Issue #15 fixed again: Force sleep delay to be a float to appease gevent.
  251. - Issue #29 fixed: DataWatch and ChildrenWatch properly re-register their
  252. watches on server disconnect.
  253. 0.6 (2012-09-27)
  254. ----------------
  255. API Changes
  256. ***********
  257. - Node paths are assumed to be Unicode objects. Under Python 2 pure-ascii
  258. strings will also be accepted. Node values are considered bytes. The byte
  259. type is an alias for `str` under Python 2.
  260. - New KeeperState.CONNECTED_RO state for Zookeeper servers connected in
  261. read-only mode.
  262. - New NotReadOnlyCallError exception when issuing a write change against a
  263. server thats currently read-only.
  264. Features
  265. ********
  266. - Add support for Python 3.2, 3.3 and PyPy (only for the threading handler).
  267. - Handles connecting to Zookeeper 3.4+ read-only servers.
  268. - Automatic background scanning for a Read/Write server when connected to a
  269. server in read-only mode.
  270. - Add new Semaphore recipe.
  271. - Add a new `retry_max_delay` argument to the client and by default limit the
  272. retry delay to at most an hour regardless of exponential backoff settings.
  273. - Add new `randomize_hosts` argument to `KazooClient`, allowing one to disable
  274. host randomization.
  275. Bug Handling
  276. ************
  277. - Fix bug with locks not handling intermediary lock contenders disappearing.
  278. - Fix bug with set_data type check failing to catch unicode values.
  279. - Fix bug with gevent 0.13.x backport of peekable queue.
  280. - Fix PatientChildrenWatch to use handler specific sleep function.
  281. 0.5 (2012-09-06)
  282. ----------------
  283. Skipping a version to reflect the magnitude of the change. Kazoo is now a pure
  284. Python client with no C bindings. This release should run without a problem
  285. on alternate Python implementations such as PyPy and Jython. Porting to Python
  286. 3 in the future should also be much easier.
  287. Documentation
  288. *************
  289. - Docs have been restructured to handle the new classes and locations of the
  290. methods from the pure Python refactor.
  291. Bug Handling
  292. ************
  293. This change may introduce new bugs, however there is no longer the possibility
  294. of a complete Python segfault due to errors in the C library and/or the C
  295. binding.
  296. - Possible segfaults from the C lib are gone.
  297. - Password mangling due to the C lib is gone.
  298. - The party recipes didn't set their participating flag to False after
  299. leaving.
  300. Features
  301. ********
  302. - New `client.command` and `client.server_version` API, exposing Zookeeper's
  303. four letter commands and giving access to structured version information.
  304. - Added 'include_data' option for get_children to include the node's Stat
  305. object.
  306. - Substantial increase in logging data with debug mode. All correspondence with
  307. the Zookeeper server can now be seen to help in debugging.
  308. API Changes
  309. ***********
  310. - The testing helpers have been moved from `testing.__init__` into a
  311. `testing.harness` module. The official API's of `KazooTestCase` and
  312. `KazooTestHarness` can still be directly imported from `testing`.
  313. - The kazoo.handlers.util module was removed.
  314. - Backwards compatible exception class aliases are provided for now in kazoo
  315. exceptions for the prior C exception names.
  316. - Unicode strings now work fine for node names and are properly converted to
  317. and from unicode objects.
  318. - The data value argument for the create and create_async methods of the
  319. client was made optional and defaults to an empty byte string. The data
  320. value must be a byte string. Unicode values are no longer allowed and
  321. will raise a TypeError.
  322. 0.3 (2012-08-23)
  323. ----------------
  324. API Changes
  325. ***********
  326. - Handler interface now has an rlock_object for use by recipes.
  327. Bug Handling
  328. ************
  329. - Fixed password bug with updated zc-zookeeper-static release, which retains
  330. null bytes in the password properly.
  331. - Fixed reconnect hammering, so that the reconnection follows retry jitter and
  332. retry backoff's.
  333. - Fixed possible bug with using a threading.Condition in the set partitioner.
  334. Set partitioner uses new rlock_object handler API to get an appropriate RLock
  335. for gevent.
  336. - Issue #17 fixed: Wrap timeout exceptions with staticmethod so they can be
  337. used directly as intended. Patch by Bob Van Zant.
  338. - Fixed bug with client reconnection looping indefinitely using an expired
  339. session id.
  340. 0.2 (2012-08-12)
  341. ----------------
  342. Documentation
  343. *************
  344. - Fixed doc references to start_async using an AsyncResult object, it uses
  345. an Event object.
  346. Bug Handling
  347. ************
  348. - Issue #16 fixed: gevent zookeeper logging failed to handle a monkey patched
  349. logging setup. Logging is now setup such that a greenlet is used for logging
  350. messages under gevent, and the thread one is used otherwise.
  351. - Fixed bug similar to #14 for ChildrenWatch on the session listener.
  352. - Issue #14 fixed: DataWatch had inconsistent handling of the node it was
  353. watching not existing. DataWatch also properly spawns its _get_data function
  354. to avoid blocking session events.
  355. - Issue #15 fixed: sleep_func for SequentialGeventHandler was not set on the
  356. class appropriately leading to additional arguments being passed to
  357. gevent.sleep.
  358. - Issue #9 fixed: Threads/greenlets didn't gracefully shut down. Handler now
  359. has a start/stop that is used by the client when calling start and stop that
  360. shuts down the handler workers. This addresses errors and warnings that could
  361. be emitted upon process shutdown regarding a clean exit of the workers.
  362. - Issue #12 fixed: gevent 0.13 doesn't use the same start_new_thread as gevent
  363. 1.0 which resulted in a fully monkey-patched environment halting due to the
  364. wrong thread. Updated to use the older kazoo method of getting the real thread
  365. module object.
  366. API Changes
  367. ***********
  368. - The KazooClient handler is now officially exposed as KazooClient.handler
  369. so that the appropriate sync objects can be used by end-users.
  370. - Refactored ChildrenWatcher used by SetPartitioner into a publicly exposed
  371. PatientChildrenWatch under recipe.watchers.
  372. Deprecations
  373. ************
  374. - connect/connect_async has been renamed to start/start_async to better match
  375. the stop to indicate connection handling. The prior names are aliased for
  376. the time being.
  377. Recipes
  378. *******
  379. - Added Barrier and DoubleBarrier implementation.
  380. 0.2b1 (2012-07-27)
  381. ------------------
  382. Bug Handling
  383. ************
  384. - ZOOKEEPER-1318: SystemError is caught and rethrown as the proper invalid
  385. state exception in older zookeeper python bindings where this issue is still
  386. valid.
  387. - ZOOKEEPER-1431: Install the latest zc-zookeeper-static library or use the
  388. packaged ubuntu one for ubuntu 12.04 or later.
  389. - ZOOKEEPER-553: State handling isn't checked via this method, we track it in
  390. a simpler manner with the watcher to ensure we know the right state.
  391. Features
  392. ********
  393. - Exponential backoff with jitter for retrying commands.
  394. - Gevent 0.13 and 1.0b support.
  395. - Lock, Party, SetPartitioner, and Election recipe implementations.
  396. - Data and Children watching API's.
  397. - State transition handling with listener registering to handle session state
  398. changes (choose to fatal the app on session expiration, etc.)
  399. - Zookeeper logging stream redirected into Python logging channel under the
  400. name 'Zookeeper'.
  401. - Base client library with handler support for threading and gevent async
  402. environments.