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

QUIC: Immediate-Mode Polling API #24388

Open
wants to merge 39 commits into
base: feature/quic-server
Choose a base branch
from

Conversation

hlandau
Copy link
Member

@hlandau hlandau commented May 13, 2024

Fixes openssl/project#299.
Built on #24257.
Review #24257 first.

d8385dd9e4 QUIC REACTOR: Add support for external registration of blocking operations
8ec02de2d5 QUIC REACTOR: Add utility for tracking recursive blocking operations
56d6ebf7b8 QUIC APL: Add support for registering blocking operations to support polling code
30af4c907d RIO: Add poll builder to support immediate-mode polling API
2375d0b65e RIO: Amend SSL_poll to support blocking on QUIC objects
1b81bcf33a QUIC POLLING: Add support for polling listeners
3e67ccf9aa RIO: Amend SSL_poll code to correctly register blocking operations for inter-thread notification
7d9072be79 QUIC APL: Fix various functions when called on listeners
fa73f213f5 QUIC MULTISTREAM TEST: Remove test that blocking SSL_poll doesn't work
70195836be QUIC RADIX: Test new SSL_poll functionality
298de370d0 QUIC RADIX: Test listener polling support
44cb8d9069 QUIC RADIX: Use enhanced blocking support when testing
601ce8c6ab QUIC: Glossary updates
6af342547d QUIC: Update SSL_poll documentation

@hlandau hlandau added approval: review pending This pull request needs review by a committer approval: otc review pending This pull request needs review by an OTC member tests: deferred Tests will be added in a subsequent PR (label should be removed when the PR with tests is merged) labels May 13, 2024
@hlandau hlandau self-assigned this May 13, 2024
@github-actions github-actions bot added the severity: ABI change This pull request contains ABI changes label May 13, 2024
@t8m t8m added the triaged: feature The issue/pr requests/adds a feature label May 16, 2024

ql->domain = ctx.qd;
ql->engine = ctx.qd->engine;
ql->mutex = ctx.qd->mutex;
Copy link
Contributor

Choose a reason for hiding this comment

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

the definition of ql->mutex is gated on OPENSSL_THREADS. A build configured with no-threads will break here as ->mutex will be undefined

* Make socket close-on-exec unless this was already done above at socket
* creation time.
*/
if (!set_cloexec(fd)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand this comment. The socket is created by this function, so this is socket creation time, no?

goto err;

/* Make both sides of the connection non-blocking. */
if (!BIO_socket_nbio(rfd, 1))
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're doing non-blocking io on a tcp socket here, wouldn't it be simpler to just use a dgram pair?

*/
if (rtor->have_notifier && rtor->signalled_notifier) {
if (rtor->cur_blocking_waiters == 0) {
ossl_rio_notifier_unsignal(&rtor->notifier);
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't put my finger on the exact reason why, but having to do un-signaling here feels wrong. need to think about this some more

type |= SOCK_NONBLOCK;
# endif

#if defined(OPENSSL_SYS_UNIX) && defined(AF_UNIX)
Copy link
Contributor

Choose a reason for hiding this comment

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

According to this:
https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/socketpair.2.html
socketpair is only implemented in macos for SYS_UNIX, but I think our macosx builds define OPENSSL_SYS_MACOSX rather than OPENSSL_SYS_UNIX. This should likely be expanded to support setting AF_UNIX for that platform

@t8m t8m closed this May 29, 2024
@t8m t8m reopened this May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: otc review pending This pull request needs review by an OTC member approval: review pending This pull request needs review by a committer severity: ABI change This pull request contains ABI changes tests: deferred Tests will be added in a subsequent PR (label should be removed when the PR with tests is merged) triaged: feature The issue/pr requests/adds a feature
Projects
Status: Awaits review
Status: Awaits review
Development

Successfully merging this pull request may close these issues.

QUIC Server - Implementation - Polling - Immediate Mode
3 participants