From f5cab82025097a43e50d2b643fd7a2e3c49f97a9 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 16 Aug 2019 16:06:14 +0200 Subject: [PATCH] MINOR: fd: make sure to mark the thread as not stuck in fd_update_events() When I/O events are being processed, we want to make sure to mark the thread as not stuck. The reason is that some pollers (like poll()) which do not limit the number of FDs they report could possibly report a huge amount of FD all having to perform moderately expensive operations in the I/O callback (e.g. via mux-pt which forwards to the upper layers), making the watchdog think the thread is stuck since it does not schedule. Of course this must never happen but if it ever does we must be liberal about it. This should be backported to 2.0, where the situation may happen more easily due to the FD cache which can start to collect a large amount of events. It may be related to the report in issue #201 though nothing is certain about it. --- include/proto/fd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/proto/fd.h b/include/proto/fd.h index 4fbb9dc1a..e146976b2 100644 --- a/include/proto/fd.h +++ b/include/proto/fd.h @@ -415,6 +415,8 @@ static inline void fd_update_events(int fd, int evts) if (fdtab[fd].iocb) fdtab[fd].iocb(fd); + + ti->flags &= ~TI_FL_STUCK; // this thread is still running } /* Prepares for being polled */