summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Dont call conn.close() with client _lock in state change callbackstate_change_callback_no_lock_closeDana Powers2019-03-311-1/+5
|
* Dont wakeup during maybe_refresh_metadata -- it is only called by poll() (#1769)Dana Powers2019-03-302-6/+6
|
* Fixups to benchmark scripts for py3 / new KafkaFixture interfacebenchmark_fixupsDana Powers2019-03-302-4/+4
|
* Revert 703f0659 / fix 0.8.2 protocol quick detection (#1763)Dana Powers2019-03-272-6/+9
|
* Send pending requests before waiting for responses (#1762)Dana Powers2019-03-271-2/+4
|
* Rename ssl.keystore.location and ssl.truststore.location config filesDana Powers2019-03-2416-32/+36
|
* Dont do client wakeup when sending from sender thread (#1761)Dana Powers2019-03-242-6/+10
|
* Update sasl configuration docstringsDana Powers2019-03-235-24/+24
|
* Support SASL OAuthBearer Authentication (#1750)Phong Pham2019-03-227-6/+117
|
* Fix flaky conn tests that use time.time (#1758)Dana Powers2019-03-211-9/+12
|
* Add py to requirements-devDana Powers2019-03-211-0/+1
|
* Maintain shadow cluster metadata for bootstrapping (#1753)Dana Powers2019-03-212-35/+21
|
* Allow configuration of SSL Ciphers (#1755)Dana Powers2019-03-214-1/+28
|
* Wrap SSL sockets after connecting (#1754)Dana Powers2019-03-211-19/+11
|
* Generate SSL certificates for local testing (#1756)Dana Powers2019-03-211-0/+29
| | | This doesn't fully implement SSL fixtures, but as a first step it should help with automatically generating required certificates / keystores / etc. My hope is that this helps generate more community support for SSL testing!
* Fix race condition in protocol.send_bytes (#1752)Filip Stefanak2019-03-211-1/+2
|
* Forgot compatibility section in docs/changelog.rstDana Powers2019-03-141-0/+8
|
* Bump version for developmentDana Powers2019-03-141-1/+1
|
* Release 1.4.51.4.5Dana Powers2019-03-144-2/+102
|
* Error if connections_max_idle_ms not larger than request_timeout_ms (#1688)Jeff Widman2019-03-142-5/+13
|
* Retry bootstrapping after backoff when necessary (#1736)Dana Powers2019-03-143-129/+112
| | | | | | | The current client attempts to bootstrap once during initialization, but if it fails there is no second attempt and the client will be inoperable. This can happen, for example, if an entire cluster is down at the time a long-running client starts execution. This commit attempts to fix this by removing the synchronous bootstrapping from `KafkaClient` init, and instead merges bootstrap metadata with the cluster metadata. The Java client uses a similar approach. This allows us to continue falling back to bootstrap data when necessary throughout the life of a long-running consumer or producer. Fix #1670
* Fix default protocol parser versionDana Powers2019-03-131-0/+3
|
* Minor updates to client_async.pyDana Powers2019-03-131-4/+4
|
* Mock dns lookups in test_conn (#1739)Dana Powers2019-03-131-1/+8
| | | Small change to avoid doing dns resolution when running local connection tests. This fixture always returns a broker on localhost:9092, so DNS lookups don't make sense here.
* Recheck connecting nodes sooner when refreshing metadata (#1737)Dana Powers2019-03-132-4/+2
|
* Don't recheck version if api_versions data is already cached (#1738)Dana Powers2019-03-131-0/+3
| | | I noticed during local testing that version probing was happening twice when connecting to newer broker versions. This was because we call check_version() once explicitly, and then again implicitly within get_api_versions(). But once we have _api_versions data cached, we can just return it and avoid probing versions a second time.
* Attempt to join heartbeat thread during close() (#1735)Dana Powers2019-03-131-3/+6
| | | | | | | Underlying issue here is a race on consumer.close() between the client, the connections/sockets, and the heartbeat thread. Although the heartbeat thread is signaled to close, we do not block for it. So when we go on to close the client and its underlying connections, if the heartbeat is still doing work it can cause errors/crashes if it attempts to access the now closed objects (selectors and/or sockets, primarily). So this commit adds a blocking thread join to the heartbeat close. This may cause some additional blocking time on consumer.close() while the heartbeat thread finishes. But it should be small in average case and in the worst case will be no longer than the heartbeat_timeout_ms (though if we timeout the join, race errors may still occur). Fix #1666
* 1701 use last offset from fetch v4 if available (#1724)Keith So2019-03-133-0/+28
|
* Catch thrown OSError by python 3.7 when creating a connection (#1694)Daniel Johansson2019-03-121-0/+3
|
* Update travis test coverage: 2.7, 3.4, 3.7, pypy2.7 (#1614)Jeff Widman2019-03-126-11/+40
| | | | | * Use xenial dist for travis builds * Use openjdk8 for all travis tests * Update python build matrix -- add 3.7, drop 3.5/3.6 (keep 2.7, 3.4, pypy2.7)
* Ignore lookup_coordinator result in commit_offsets_async (#1712)Faqa2019-03-121-1/+2
|
* Synchronize puts to KafkaConsumer protocol buffer during async sendsDana Powers2019-03-122-25/+60
|
* Do network connections and writes in KafkaClient.poll() (#1729)Dana Powers2019-03-086-57/+84
| | | | | | * Add BrokerConnection.send_pending_requests to support async network sends * Send network requests during KafkaClient.poll() rather than in KafkaClient.send() * Dont acquire lock during KafkaClient.send if node is connected / ready * Move all network connection IO into KafkaClient.poll()
* Do not require client lock for read-only operations (#1730)Dana Powers2019-03-061-50/+50
| | | In an effort to reduce the surface area of lock coordination, and thereby hopefully reduce lock contention, I think we can remove locking from the read-only KafkaClient methods: connected, is_disconnected, in_flight_request_count, and least_loaded_node . Given that the read data could change after the lock is released but before the caller uses it, the value of acquiring a lock here does not seem high to me.
* Use test.fixtures.version not test.conftest.version to avoid warnings (#1731)Dana Powers2019-03-064-8/+4
|
* Make NotEnoughReplicasError/NotEnoughReplicasAfterAppendError retriable (#1722)le-linh2019-03-031-0/+2
|
* Drop dependency on sphinxcontrib-napoleonStanislav Levin2019-02-271-1/+0
| | | | | | | | | Since 1.3b1 (released Oct 10, 2014) Sphinx has support for NumPy and Google style docstring support via sphinx.ext.napoleon extension. The latter is already used, but sphinxcontrib-napoleon requirement still presents. Signed-off-by: Stanislav Levin <slev@altlinux.org>
* Fix test_legacy_correct_metadata_response on x86 arch (#1718)Stanislav Levin2019-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that the type of required operation result is "long". ``` >>> type(278251978 & 0xffffffff) <type 'long'> ``` However, by default "format" method uses __format__(): ``` >>> (278251978 & 0xffffffff).__format__('') '278251978' ``` So, let's compare things using the same engine: ``` >>> "{!r}".format(278251978 & 0xffffffff) '278251978L' ``` Fixes: https://github.com/dpkp/kafka-python/issues/1717 Signed-off-by: Stanislav Levin <slev@altlinux.org>
* Remove unused importJeff Widman2019-01-281-1/+0
|
* Improve KafkaConsumer join group / only enable Heartbeat Thread during ↵Dana Powers2019-01-151-11/+23
| | | | stable group (#1695)
* Travis CI: 'sudo' tag is now deprecated in Travis (#1698)cclauss2019-01-131-2/+0
|
* Remove unused `skip_double_compressed_messages`Jeff Widman2019-01-132-16/+0
| | | | | | | | | | This `skip_double_compressed_messages` flag was added in https://github.com/dpkp/kafka-python/pull/755 in order to fix https://github.com/dpkp/kafka-python/issues/718. However, grep'ing through the code, it looks like it this is no longer used anywhere and doesn't do anything. So removing it.
* Timeout all unconnected conns (incl SSL) after request_timeout_msDana Powers2019-01-131-6/+8
|
* Fix `AttributeError` caused by `getattr()`Jeff Widman2019-01-071-1/+2
| | | | | | | `getattr(object, 'x', object.y)` will evaluate the default argument `object.y` regardless of whether `'x'` exists. For details see: https://stackoverflow.com/q/31443989/770425
* Use Popen.communicate() instead of Popen.wait()Brian Sang2019-01-051-9/+10
| | | | | Popen objects may deadlock when using stdout=PIPE or stderr=PIPE with Popen.wait(). Using Popen.communicate() avoids the issue.
* Fix SSL connection testing in Python 3.7Ben Weir2019-01-031-0/+7
|
* Fix response error checking in KafkaAdminClient send_to_controllerDana Powers2019-01-032-5/+15
| | | | | | | | | | | | Previously we weren't accounting for when the response tuple also has a `error_message` value. Note that in Java, the error fieldname is inconsistent: - `CreateTopicsResponse` / `CreatePartitionsResponse` uses `topic_errors` - `DeleteTopicsResponse` uses `topic_error_codes` So this updates the `CreateTopicsResponse` classes to match. The fix is a little brittle, but should suffice for now.
* #1681 add copy() in metrics() to avoid thread safety issues (#1682)Tosi Émeric2018-12-272-4/+4
|
* Bugfix: Types need identity comparisonJeff Widman2018-12-131-1/+1
| | | `isinstance()` won't work here, as the types require identity comparison.
* Bump version for developmentDana Powers2018-11-201-1/+1
|