-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit the number of epoll instances per active fd
XCM uses shared, always active, event fds to signal to the application that a socket is active when, for example, a message is buffered or the connection is closed. Such fds are added to the respective socket-internal epoll instance, when needed. The Linux kernel limits the number of epoll instances a file object can be registered in. See source/fs/eventpoll.c in the kernel for details. Before this change, XCM allowed the registration of a single always-active event fd in an arbitrary number of epoll instances. In certain situations (e.g, when all connections were lost), where a process had many (500+) TLS and/or TCP transport connections open, an epoll_ctl() call which is not supposed to fail with EINVAL did, triggering an abort. With this change, XCM grows the number of always-active event fds as needed, limiting the maximum number of connections using the same event fd to 100. Signed-off-by: Mattias Rönnblom <[email protected]>
- Loading branch information
1 parent
262e21d
commit 65d3fb9
Showing
5 changed files
with
82 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
#define ACTIVE_FD | ||
|
||
int active_fd_get(void); | ||
void active_fd_put(void); | ||
void active_fd_put(int fd); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters