After what I can only describe as an intense session of debugging with @rmccue we discovered that some jobs were hanging when the pipe's buffer filled up from stderr / stdout of a running job. This could be something like a cron job doing an excessive amount of error_logging.
The buffer size is relatively small by default, and I believe the runner only reads from the pipe once the child process has completed. This means the sys call to write to the pipe will hang when full.
As a "workaround" we removed the error_log calls from the job, and if need be it's possible to cat /proc/{process id of wp-cli}/fd/2 to flush the pipe buffer.
After what I can only describe as an intense session of debugging with @rmccue we discovered that some jobs were hanging when the pipe's buffer filled up from stderr / stdout of a running job. This could be something like a cron job doing an excessive amount of error_logging.
The buffer size is relatively small by default, and I believe the runner only reads from the pipe once the child process has completed. This means the sys call to write to the pipe will hang when full.
As a "workaround" we removed the
error_log
calls from the job, and if need be it's possible tocat /proc/{process id of wp-cli}/fd/2
to flush the pipe buffer.