-
Notifications
You must be signed in to change notification settings - Fork 46
conn: create from socket fd #316
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
conn: create from socket fd #316
Conversation
f033280
to
df0eec0
Compare
df0eec0
to
5b9f1cc
Compare
c77681b
to
8aaece6
Compare
There will be one more test (with Tarantool made sockets and child process), but in general it is already ready for the review. |
7d6454e
to
39815c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
select
must have respect the timeout setting for non-blocking sockets.- We need to think what we could to do if fd the socket is blocking and the timeout is set. The only way I see is to turn the socket into non-blocking mode.
39815c1
to
02d7bc2
Compare
02d7bc2
to
5712143
Compare
5712143
to
6b00156
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the patch!
d470f82
to
42e7f85
Compare
195b3c9
to
543e17d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long delay, I was a bit busy. Let's fix the last description and I'll merge it.
tarantool/connection.py
Outdated
raise ConfigurationError("need to specify both host and port, " | ||
"port only in the case on Unix sockets, " | ||
"or socket_fd in the case of socket fd") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise ConfigurationError("need to specify both host and port, " | |
"port only in the case on Unix sockets, " | |
"or socket_fd in the case of socket fd") | |
raise ConfigurationError("need to specify host/port, " | |
"port (in case of Unix sockets)" | |
"or socket_fd") |
This patch adds the ability to create Tarantool connection using an existing socket fd. To achieve this, several changes have been made to work with non-blocking sockets, as `socket.socketpair` creates such [1]. The authentication [2] might have already occured when we establish such a connection. If that's the case, there is no need to pass 'user' argument. On success, connect takes ownership of the `socket_fd`. 1. tarantool/tarantool#8944 2. https://www.tarantool.io/en/doc/latest/dev_guide/internals/iproto/authentication/ Closes #304
543e17d
to
8da5df2
Compare
This patch adds the ability to create Tarantool connection using an existing socket fd.
I didn't forget about:
Closes #304