Skip to content

Improve KafkaConnection with more tests #196

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

Merged
merged 17 commits into from
Aug 22, 2014
Merged

Improve KafkaConnection with more tests #196

merged 17 commits into from
Aug 22, 2014

Conversation

dpkp
Copy link
Owner

@dpkp dpkp commented Aug 18, 2014

Handle connection failures in KafkaConnection.reinit
Set _sock=None in close()
Also check for no _sock when checking for _dirty
Add a few more debugging log messages
Implement the skipped connection tests in test/test_conn.py

@@ -55,6 +55,7 @@ def __init__(self, host, port, timeout=DEFAULT_SOCKET_TIMEOUT_SECONDS):
self.host = host
self.port = port
self.timeout = timeout
self._dirty = None
Copy link
Collaborator

Choose a reason for hiding this comment

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

any reason this is None instead of False? True|False is used everywhere else.

Copy link
Owner Author

Choose a reason for hiding this comment

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

_dirty is a description of the state of our socket in _sock. Because we dont have a _sock yet, we also dont really have a _dirty state either. But to be consistent we should probably set also _dirty to None in close() when we set _sock to None

dpkp added a commit that referenced this pull request Aug 22, 2014
Improve KafkaConnection with more tests
@dpkp dpkp merged commit d73d169 into dpkp:master Aug 22, 2014
@dpkp dpkp deleted the reinit_connection_error branch August 27, 2014 21:11
wbarnha pushed a commit to orange-kao/kafka-python that referenced this pull request Aug 17, 2024
According to [rfc5802](https://datatracker.ietf.org/doc/html/rfc5802), username should escape special characters before sending to the server.
> The characters ',' or '=' in usernames are sent as '=2C' and
         '=3D' respectively.  If the server receives a username that
         contains '=' not followed by either '2C' or '3D', then the
         server MUST fail the authentication.
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.

2 participants