Kestrel should set O_CLOEXEC flag when listening on socket passed in via file descriptor
Open
area-networking
feature-kestrel
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
Kestrel should set `O_CLOEXEC` flag on socket when listening on socket passed in via file descriptor (e.g., systemd activation). We're currently leaking these file descriptor to child processes.
There is currently no managed API that wraps [`fcntl()`](https://man7.org/linux/man-pages/man2/fcntl.2.html), so we may have to P/Invoke in Kestrel to achieve this behavior.
Related: https://github.com/dotnet/runtime/issues/46832
Contributor guide
Assessment
This issue has not been assessed yet.