Closed helmo closed 6 years ago
This is plainly wrong and doesn't fix the underlying bug but hides it!
stream_select()
changes the arrays passed by reference to only include those streams readable: https://www.php.net/manual/de/function.stream-select.php
The bug reported here resulted from the timeout in stream_select()
.
If $this->fd
listed in $read
is not readable after 60 seconds, stream_select()
will return and $read
is then modified to list all streams readable (none in this case).
Subsequent calls to stream_select()
operate on an empty $read
array afterwards.
That's the underlying bug.
Your "fix" made matters worse because the files_external:notify
command now terminates after ~60 seconds instead of running continuously (as stated in the docs).
Correct fix would be to set $read = [$this->fd]
before every stream_select()
call, I'll do a pull request.
After installing I collected 20GB of log with just this line in a matter of hours.
I'm not sure how the $read array becomes invalid, but adding ' && !empty($read)' in the while statement seems to help.