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

Fix ssl connection #178

Merged
merged 7 commits into from
Apr 10, 2024
Merged

Conversation

dingxiong
Copy link

@dingxiong dingxiong commented Apr 10, 2024

See issue #177

For SSL protocol, the socket will be wrapped inside a SSLSocket instance, and the original socket will be detached, i.e., closed without closing the underlying file description. This leads to -1 socket.fileno inside Epoll selector.
This does not create any problem until #156 , which unregisters fd based on socket.fileno.

We can just check key.fd instead of key.fileob.fileno() on top of #156, but I think a better solution is to handle SSL socket more gracefully. Having a registered socket with key.fd != key.fileobj.fileno() is error-prone in my opinion.

kafka/client_async.py Outdated Show resolved Hide resolved
@wbarnha
Copy link
Owner

wbarnha commented Apr 10, 2024

Besides the aforementioned change I've suggested, everything else here I agree with. Thanks a bunch, I'm looking forward to getting this merged.

@wbarnha wbarnha merged commit 611471f into wbarnha:master Apr 10, 2024
21 checks passed
Copy link

@Bolaekputi Bolaekputi left a comment

Choose a reason for hiding this comment

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

Lee

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.

3 participants