Skip to content

Exhausting file descriptors when direct variants are used #924

Closed Answered by axboe
cmazakas asked this question in Q&A
Discussion options

You must be logged in to vote

I write a small reproducer, but seems to work fine for me. See below paste. It sets up NFILES sparse descriptors, and uses multishot accept to get connections. When we hit NFILES of connections, we randomly close one of the previous ones. Run this for 4 * NFILES, works for me.

You neglected to mention what kernel you are running, just in case this is a kernel issue.

Code:

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <liburing.h>

enum {
	T_EXIT_PASS = 0,
	T_EXIT_SKIP = 77,
	T_EXIT_FAIL = 1,
};

static int use_port…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by cmazakas
Comment options

You must be logged in to vote
1 reply
@cmazakas
Comment options

Comment options

You must be logged in to vote
1 reply
@axboe
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants