MDEV-22992 Refactor VIO into layered transports and filters - #5584
Open
vaintroub wants to merge 1 commit into
Open
MDEV-22992 Refactor VIO into layered transports and filters#5584vaintroub wants to merge 1 commit into
vaintroub wants to merge 1 commit into
Conversation
Copilot stopped reviewing on behalf of
vaintroub due to an error
August 21, 2026 15:22
vaintroub
force-pushed
the
main-MDEV-22992
branch
from
August 24, 2026 12:08
59740b2 to
30a7a51
Compare
vaintroub
requested
a lite review from Copilot
and removed request for
Copilot
August 24, 2026 18:42
Copilot stopped reviewing on behalf of
vaintroub due to an error
August 24, 2026 19:03
vaintroub
force-pushed
the
main-MDEV-22992
branch
3 times, most recently
from
August 24, 2026 21:40
626d759 to
6912e7f
Compare
Replace the function-pointer VIO implementation with an abstract C++ interface while retaining the procedural C entry points. Implement socket and named-pipe transports and composable filters for client read-ahead, Windows thread-pool prefetch, and TLS. OpenSSL uses a custom BIO, while wolfSSL uses callbacks that perform I/O through the VIO below the TLS filter. This keeps waits and timeouts in the transport layer. Keep sockets nonblocking and implement timed I/O with transport waits. Named pipes use overlapped I/O for timeout-aware waits and report blocking waits through the same scheduler callbacks as sockets. Semi-sync temporarily changes the real VIO read timeout instead of copying VIO state. Hide transport and TLS implementation state behind accessors. Expose the TLS handle opaquely and update callers that previously accessed VIO fields directly. Compile the VIO implementations as C++ and retain PSI memory accounting for VIO allocations. Adapt Windows thread-pool pre-read to a Prefetched_vio filter inserted above the transport so both plain and TLS connections consume prefetched bytes through the same layered VIO path. Cleaned header files so that vio header no longer include OpenSSL or WolfSSL headers. Removed some legacy functionality - vio_close() with its double-close guards appeared hard to maintain in class hierarchy, and had been unnecessary for the last 15 years. Associated things that are also gone : preprocessor definition SIGNAL_WITH_VIO_CLOSE (always defined), VIO_STATE_CLOSED. VIO_CLOSED type, which was used as sentinel, renamed to VIO_TYPE_INVALID. - vio_io_wait() used in a single place, replaces by read with timeout. - vio_reset() to create SSL, replaced by vio_wrap
vaintroub
force-pushed
the
main-MDEV-22992
branch
from
August 24, 2026 22:28
6912e7f to
13f5709
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the function-pointer VIO implementation with an abstract C++ interface while retaining the procedural C entry points.
Implement socket and named-pipe transports and composable filters for client read-ahead, Windows thread-pool prefetch, and TLS. OpenSSL uses a custom BIO, while wolfSSL uses callbacks that perform I/O through the VIO below the TLS filter. This keeps waits and timeouts in the transport layer.
Keep sockets nonblocking and implement timed I/O with transport waits. Named pipes use overlapped I/O for timeout-aware waits and report blocking waits through the same scheduler callbacks as sockets. Semi-sync temporarily changes the real VIO read timeout instead of copying VIO state.
Hide transport and TLS implementation state behind accessors. Expose the TLS handle opaquely and update callers that previously accessed VIO fields directly. Compile the VIO implementations as C++ and retain PSI memory accounting for VIO allocations.
Adapt Windows thread-pool pre-read to a Prefetched_vio filter inserted above the transport so both plain and TLS connections consume prefetched bytes through the same layered VIO path.