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.
This commit is contained in:
Willy Tarreau 2019-08-16 16:06:14 +02:00
parent bd9e842866
commit f5cab82025

View File

@ -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 <fd> for being polled */