MEDIUM: epoll: skip reports of stale file descriptors
authorWilly Tarreau <w@1wt.eu>
Thu, 30 Jan 2025 15:32:35 +0000 (16:32 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Apr 2025 09:05:33 +0000 (11:05 +0200)
commit1571187bb3c5f63c52b64fd4a99a0ed7b2f09ed3
treedb4e6eb9410694818dddb9b23feca1e94a190dce
parente89232adf7cf8bae56e756aad94814a3b153b4ab
MEDIUM: epoll: skip reports of stale file descriptors

Now that we can see that some events are reported for older instances
of a file descriptor, let's skip these ones instead of reporting
dangerous events on them. It might possibly qualify as a bug if it
helps fixing strange issues in certain environments, in which case it
can make sense to backport it along with the following recent patches:

  DEBUG: fd: add a counter of takeovers of an FD since it was last opened
  MINOR: fd: add a generation number to file descriptors
  DEBUG: epoll: store and compare the FD's generation count with reported event

(cherry picked from commit 8235a24782e528b9bf8ca9dd69c0a147556dfcb5)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit cdb4027d54baab39347bf2e1da48aff7d1af5429)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/ev_epoll.c