Files
cacti/lib
dwpaulx 2cae4cad8b Issue #4347 : Workaround PHP race that results in hanging rrdtool processes (#4348)
There is a race in proc_open in PHP that is currently not avoided by
setting FD_CLOEXEC on the pipe file descriptors (with the 'e' flag for
the pipes). What happens, in a multithreaded Apache environment, when
multiple rrdtools are attempted to be launched (for example, when a lot
of graphs are requested at once) is this:

Thread 1: creates pipes for stdin/stdout
Thread 2: creates pipes for stdin/stdout
Thread 1: forks process x
Thread 2: forks process y
Process x: inherits pipes from Thread 1 and Thread 2
Process y: inherits pipes from Thread 1 and Thread 2
Process x: closes 'other side' of pipes from Thread 1
Process x: executes rrdtool
Thread 1: closes 'other side' of its pipes
Thread 1: writes command to rrdtool (no trailing newline)
Thread 1: closes stdin pipe to Process x
Process x: receives command from Thread 1
Process x: waits for more data, or stdin to close
Process x: hangs, because the pipe is still open in Process y
Thread 1: waits for data from rrdtool, which never comes
(meanwhile, the same thing happens between Thread 2 and Process y)

This is really a PHP bug, and I'll see if there's a possibility to get
that fixed there, but this at least fixes the problem by allowing
rrdtool to exit, itself, instead of waiting for stdin to be closed.
2021-09-05 15:44:03 +00:00
..
2021-01-01 20:28:58 -05:00
2021-02-16 20:46:03 -05:00
2021-01-01 20:28:58 -05:00
2021-02-15 12:31:47 -05:00
2021-01-01 20:28:58 -05:00
2021-04-22 08:47:14 -04:00
2021-01-01 20:28:58 -05:00
2021-03-14 14:55:00 -04:00
2021-01-01 20:28:58 -05:00
2021-01-01 20:28:58 -05:00
2021-01-01 20:28:58 -05:00
2021-03-13 15:44:53 -05:00
2021-07-01 12:04:06 -04:00
2021-01-01 20:28:58 -05:00
2021-01-01 20:28:58 -05:00
2021-09-05 17:03:40 +02:00
2021-02-20 12:57:59 -05:00
2017-08-12 23:56:08 -04:00
2021-02-18 07:21:35 -05:00
2021-01-01 20:28:58 -05:00
2021-01-01 20:28:58 -05:00
2021-01-01 20:28:58 -05:00
2021-05-14 17:56:54 +01:00
2021-01-01 20:28:58 -05:00
2021-01-01 20:28:58 -05:00