Bug 27 - Fail gracefully if sockets (or other file descriptors) can't be opened
Summary: Fail gracefully if sockets (or other file descriptors) can't be opened
Status: RESOLVED FIXED
Alias: None
Product: passt
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Linux
: High enhancement
Assignee: nobody
URL:
Depends on:
Blocks:
 
Reported: 2022-10-27 19:31 UTC by Stefano Brivio
Modified: 2023-03-24 10:30 UTC (History)
0 users

See Also:


Attachments

Description Stefano Brivio 2022-10-27 19:31:38 UTC
If passt forwards many or all ports, it needs to open a relatively significant
amount of file descriptors. We're already setting the RLIMIT_NOFILE soft quota
to match the hard quota via setrlimit() in main(), but that's not necessarily
enough on some distributions.

If we can't open enough file descriptors, we'll just go ahead, bind as many
ports as we can, and warn about the rest. In pasta mode, we might fail from time
to time to establish spliced connections.

This is not necessarily desirable, because we're doing something wildly
different compared to what we were configured for. Fail gracefully instead: if
we can't bind for that reason (and not getting, say, EACCES), explain and quit,
so that the user realises right away.

Note You need to log in before you can comment on or make changes to this bug.