Open furkanonder opened 1 month ago
home$ cat fd_count.c
#include <stdio.h>
#include <sys/select.h>
int main() {
printf("FD_SETSIZE: %d\n", FD_SETSIZE);
return 0;
}
home$ gcc fd_count.c -o fd_count.o
home$ ./fd_count.o
FD_SETSIZE: 256
home$ ulimit -Sn
1024
home$ ulimit -Hn
3404
home$ ulimit -n
1024
I don't think there is a leak, the test was successful when I increased the number of file descriptors with ulimit
.
home# ulimit -n 2048
home# ./python -m test test_subprocess -m test_no_leaking
Using random seed: 389439817
0:00:00 load avg: 0.11 Run 1 test sequentially in a single process
0:00:00 load avg: 0.11 [1/1] test_subprocess
== Tests result: SUCCESS ==
1 test OK.
Total duration: 467 ms
Total tests: run=2 (filtered) skipped=2
Total test files: run=1/1 (filtered)
Result: SUCCESS
home#
I can set the max_handles=1020
as final value, above the 1020 the test is failing. In the system FD_SETSIZE
is equal to 256. That's why I thought to set max_handles as 2 times the FD_SETSIZE
value in the test.
Bug report
Bug description:
Output:
CPython versions tested on:
CPython main branch
Operating systems tested on:
Other
Linked PRs