Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor client cleanups #1740

Merged
merged 2 commits into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions kafka/client_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import functools
import logging
import random
import socket
import threading
import time
import weakref

# selectors in stdlib as of py3.4
Expand All @@ -15,9 +17,6 @@
# vendored backport module
from kafka.vendor import selectors34 as selectors

import socket
import time

from kafka.vendor import six

from kafka.cluster import ClusterMetadata
Expand Down Expand Up @@ -611,7 +610,8 @@ def poll(self, timeout_ms=None, future=None):
return responses

def _poll(self, timeout):
"""Returns list of (response, future) tuples"""
# This needs to be locked, but since it is only called from within the
# locked section of poll(), there is no additional lock acquisition here
processed = set()

start_select = time.time()
Expand Down
3 changes: 3 additions & 0 deletions kafka/conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ def __init__(self, host, port, afi, **configs):

self.node_id = self.config.pop('node_id')

if self.config['api_version'] is None:
self.config['api_version'] = self.DEFAULT_CONFIG['api_version']

if self.config['receive_buffer_bytes'] is not None:
self.config['socket_options'].append(
(socket.SOL_SOCKET, socket.SO_RCVBUF,
Expand Down