symfony processが詰まる理由
symfony processを使っていると、プロセスが60秒で終了してしまう。
Symfony Processのデフォルトタイムアウトかな。
Exit code 143 corresponds to SIGTERM, which is the signal sent by default when you run kill . Did you or the OS kill the process? Is it an infinite loop that you eventually killed? https://stackoverflow.com/questions/58676871/when-i-run-this-code-it-return-that-exit-status-143-in-java
パイプが詰まってる
Symfonyのプロセスを見ていると、UNIXのPIPEや php://temp を使うように設計されている。
-stdout: stream resource {@844 wrapper_type: "PHP" stream_type: "TEMP" mode: "w+b" unread_bytes: 0 seekable: true uri: "php://temp/maxmemory:1048576" options: [] } -stderr: stream resource {@846 wrapper_type: "PHP" stream_type: "TEMP" mode: "w+b" unread_bytes: 0 seekable: true uri: "php://temp/maxmemory:1048576" options: [] }
これはPIPEが詰まりますわ。
逐次読み出しておく。
Processからのアウトプットが大量に来るとき(たとえばffmpegで変換していて、php側の変数に受ける)とかやりたいときは、いったん適当なファイルにパイプを読み出しておかないと詰まってデッドロックしそうですね。