-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
extension: User space io socket #14917
Conversation
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
/assign @antoniovicente |
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.
First pass. Sorry for not getting to this earlier.
source/extensions/io_socket/user_space/io_socket_handle_impl.cc
Outdated
Show resolved
Hide resolved
source/extensions/io_socket/user_space/io_socket_handle_impl.cc
Outdated
Show resolved
Hide resolved
source/extensions/io_socket/user_space/io_socket_handle_impl.cc
Outdated
Show resolved
Hide resolved
source/extensions/io_socket/user_space/io_socket_handle_impl.cc
Outdated
Show resolved
Hide resolved
source/extensions/io_socket/user_space/io_socket_handle_impl.cc
Outdated
Show resolved
Hide resolved
source/extensions/io_socket/user_space/io_socket_handle_impl.cc
Outdated
Show resolved
Hide resolved
test/extensions/io_socket/user_space/io_socket_handle_impl_platform_test.cc
Outdated
Show resolved
Hide resolved
test/extensions/io_socket/user_space/io_socket_handle_impl_platform_test.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
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.
Partial fix
source/extensions/io_socket/user_space/io_socket_handle_impl.cc
Outdated
Show resolved
Hide resolved
source/extensions/io_socket/user_space/io_socket_handle_impl.cc
Outdated
Show resolved
Hide resolved
source/extensions/io_socket/user_space/io_socket_handle_impl.cc
Outdated
Show resolved
Hide resolved
source/extensions/io_socket/user_space/io_socket_handle_impl.cc
Outdated
Show resolved
Hide resolved
source/extensions/io_socket/user_space/io_socket_handle_impl.cc
Outdated
Show resolved
Hide resolved
source/extensions/io_socket/user_space/io_socket_handle_impl.cc
Outdated
Show resolved
Hide resolved
test/extensions/io_socket/user_space/io_socket_handle_impl_platform_test.cc
Outdated
Show resolved
Hide resolved
source/extensions/io_socket/user_space/io_socket_handle_impl.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
test/extensions/io_socket/user_space/io_socket_handle_impl_platform_test.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@antoniovicente All comments resolved. |
@@ -286,13 +293,11 @@ Api::SysCallIntResult IoHandleImpl::setBlocking(bool) { return makeInvalidSyscal | |||
absl::optional<int> IoHandleImpl::domain() { return absl::nullopt; } | |||
|
|||
Network::Address::InstanceConstSharedPtr IoHandleImpl::localAddress() { | |||
// TODO(lambdai): Rewrite when caller accept error as the return value. | |||
throw EnvoyException(fmt::format("getsockname failed for IoHandleImpl")); | |||
return IoHandleImpl::getCommonInternalAddress(); |
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.
This seems odd. All internal handles have the same address, no way to log which is which.
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.
Not sure how can this address be used....
This address doesn't provide the ability to connect to or listen. The connection socket could use AddressProvider to set the view of local address and remote address anyway
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.
The address may be useful in logs to tell what is connected to what.
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.
Let's leave it to the next phase when we do pass a reasonable address to IoHandleImpl
test/extensions/io_socket/user_space/io_handle_impl_platform_test.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
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.
cc @envoyproxy/senior-maintainers
I think changes look good. I think this PR is ready for review by a non-googler senior maintainer.
test/extensions/io_socket/user_space/io_handle_impl_platform_test.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
/retest Windows CI looks like an unrelated flaky issue. These new libraries are not linked into the failing test. |
Retrying Azure Pipelines: |
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.
This looks great overall.
/wait
|
||
Api::IoCallUint64Result IoHandleImpl::read(Buffer::Instance& buffer, | ||
absl::optional<uint64_t> max_length_opt) { | ||
// Below value comes from Buffer::OwnedImpl::default_read_reservation_size_. |
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.
I think it would be better to expose this value somehow and use it from OwnedImpl. Otherwise this may get out of sync at some point, which will be easy to not notice.
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.
I am creating an issue to track the next step.
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.
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
merging main |
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
gentle ping @ggreenway |
Thank you! |
Commit Message:
Userspace io socket, cont
Introduce user space io socket handle on top of user space event at #14712
Userspace Io socket handles are always created with a peering handle.
The write() methods populate the buffer in the peer handle.
The read() methods consume the owned buffer.
Extracted from #13418
Signed-off-by: Yuchen Dai silentdai@gmail.com
Additional Description:
Risk Level: LOW, extension
Testing: Unit test
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]