Skip to content

[GIT PULL] test: add connect-backlog test - #1664

Merged
axboe merged 1 commit into
axboe:masterfrom
daandemeyer:connect-backlog
Oct 28, 2026
Merged

axboe merged 1 commit into
axboe:masterfrom
daandemeyer:connect-backlog

Conversation

@daandemeyer

Copy link
Copy Markdown
Contributor

IORING_OP_CONNECT on a non-blocking AF_UNIX socket whose listener has a
full backlog retries the connect 128 times, then punts it to an io-wq
worker, and still completes with -EAGAIN. The new connect-backlog test
checks that the request completes with -EAGAIN without starting an io-wq
worker. It also checks that a blocking connect waits until accept()
makes room, and that a non-blocking TCP connect that gets -EINPROGRESS
waits for the handshake to complete.

The non-blocking case fails on kernels without the kernel patch
"io_uring/net: don't retry a non-blocking connect() that fails with
-EAGAIN".


git request-pull output:

The following changes since commit a33a770d8379978660036251e14710c6ee8a3d34:

  Merge branch 'ringbuf-read-fname-bound' of https://github.com/rootvector2/liburing (2026-05-28 06:43:37 -0600)

are available in the Git repository at:

  https://github.com/DaanDeMeyer/liburing connect-backlog

for you to fetch changes up to 220aa1eb5c568e04ef43f6e0dd4bd96eb63f14f7:

  test: add connect-backlog test (2026-10-27 14:56:58 +0100)

----------------------------------------------------------------
Daan De Meyer (1):
      test: add connect-backlog test

 test/Makefile          |   1 +
 test/connect-backlog.c | 444 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 445 insertions(+)
 create mode 100644 test/connect-backlog.c

Click to show/hide pull request guidelines

Pull Request Guidelines

  1. To make everyone easily filter pull request from the email
    notification, use [GIT PULL] as a prefix in your PR title.
[GIT PULL] Your Pull Request Title
  1. Follow the commit message format rules below.
  2. Follow the Linux kernel coding style (see: https://github.com/torvalds/linux/blob/master/Documentation/process/coding-style.rst).

Commit message format rules:

  1. The first line is title (don't be more than 72 chars if possible).
  2. Then an empty line.
  3. Then a description (may be omitted for truly trivial changes).
  4. Then an empty line again (if it has a description).
  5. Then a Signed-off-by tag with your real name and email. For example:
Signed-off-by: Foo Bar <foo.bar@gmail.com>

The description should be word-wrapped at 72 chars. Some things should
not be word-wrapped. They may be some kind of quoted text - long
compiler error messages, oops reports, Link, etc. (things that have a
certain specific format).

Note that all of this goes in the commit message, not in the pull
request text. The pull request text should introduce what this pull
request does, and each commit message should explain the rationale for
why that particular change was made. The git tree is canonical source
of truth, not github.

Each patch should do one thing, and one thing only. If you find yourself
writing an explanation for why a patch is fixing multiple issues, that's
a good indication that the change should be split into separate patches.

If the commit is a fix for an issue, add a Fixes tag with the issue
URL.

Don't use GitHub anonymous email like this as the commit author:

123456789+username@users.noreply.github.com

Use a real email address!

Commit message example:

src/queue: don't flush SQ ring for new wait interface

If we have IORING_FEAT_EXT_ARG, then timeouts are done through the
syscall instead of by posting an internal timeout. This was done
to be both more efficient, but also to enable multi-threaded use
the wait side. If we touch the SQ state by flushing it, that isn't
safe without synchronization.

Fixes: https://github.com/axboe/liburing/issues/402
Signed-off-by: Jens Axboe <axboe@kernel.dk>

By submitting this pull request, I acknowledge that:

  1. I have followed the above pull request guidelines.
  2. I have the rights to submit this work under the same license.
  3. I agree to a Developer Certificate of Origin (see https://developercertificate.org for more information).

IORING_OP_CONNECT on a non-blocking AF_UNIX socket whose listener has a
full backlog retries the connect 128 times and then punts it to io-wq.
The io-wq attempt is non-blocking too, so the request fails with -EAGAIN
anyway, like connect(2) does right away. Let's test that the request
completes with -EAGAIN without starting an io-wq worker.

Also test that a blocking connect to a full backlog waits until accept()
makes room, and that a non-blocking TCP connect that gets -EINPROGRESS
waits for the handshake to complete. Each test runs in its own process,
so it doesn't see io-wq workers that an earlier test started.

The non-blocking test fails on kernels without the kernel commit
"io_uring/net: don't retry a non-blocking connect() that fails with
-EAGAIN".

Signed-off-by: Daan De Meyer <daan@amutable.com>
@daandemeyer

Copy link
Copy Markdown
Contributor Author

Might be a bit excessive to add a test for this, can always close this if it's too much

@axboe

axboe commented Oct 28, 2026

Copy link
Copy Markdown
Owner

I think adding weird corner cases is the best use of a test case, I'll pull it in. Yes it's not the most important thing, but may as well check for it.

@axboe
axboe merged commit c6da613 into axboe:master Oct 28, 2026
19 of 20 checks passed
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.

2 participants