You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the child process runs, php test.php consumes 100% CPU when running on the ExtEventLoop. Additionally, the connection is closed directly instead of one second later if there's currently a child process running.
Thank you for filing this issue! I think it serves as a valid reference that suggests reactphp/child-process#51 may actually be an issue for some use cases.
Given that it's related to this known issue in another component, I don't see much that we could do here in this component.
I believe this has been answered, so I'm closing this for now. Please come back with more details if this problem persists and we can reopen this 👍
@clue It works fine with the StreamSelectLoop. While it might be related to the linked issue, it probably shouldn't result in 100% CPU usage. The only expected issue with reactphp/child-process#51 is connections being kept open, but stream_socket_shutdown seems to solve that. Without stream_socket_shutdown, I get the expected hanging behavior with the StreamSelectLoop. I believe this is a separate issue.
No worries, I'll make sure to ping you if nothing changes about this issue in a few days and will reopen if you send a gist to reproduce this! 👍 Thank you.
It's weird. If I try to look into it with phpdbg and pause the execution and continue it again, the 100% CPU usage is gone. Seems to be a Heisenbug. Haven't found another reproduction case, because I'm not sure what causes it. So no, it's not resolved as stated previously. It's not the expected misbehavior that reactphp/child-process#51 might cause, as previously stated.
I've ran into this issue aswell, i'm installing react/child-process:0.6.1 from composer, and the default event loop (React\EventLoop\ExtUvLoop) consumes 100% of the CPU.
If i explicitly set it to StreamSelectLoop, the process works as expected at around 5-10% CPU usage.
Activity
clue commentedon Oct 12, 2017
Thank you for filing this issue! I think it serves as a valid reference that suggests reactphp/child-process#51 may actually be an issue for some use cases.
Given that it's related to this known issue in another component, I don't see much that we could do here in this component.
I believe this has been answered, so I'm closing this for now. Please come back with more details if this problem persists and we can reopen this 👍
kelunik commentedon Oct 12, 2017
@clue It works fine with the
StreamSelectLoop. While it might be related to the linked issue, it probably shouldn't result in 100% CPU usage. The only expected issue with reactphp/child-process#51 is connections being kept open, butstream_socket_shutdownseems to solve that. Withoutstream_socket_shutdown, I get the expected hanging behavior with theStreamSelectLoop. I believe this is a separate issue.clue commentedon Oct 12, 2017
Can you send in a gist to reproduce this issue without the known issue linked above? Thank you.
kelunik commentedon Oct 12, 2017
Please re-open the issue, so I don't forget about it.
clue commentedon Oct 12, 2017
No worries, I'll make sure to ping you if nothing changes about this issue in a few days and will reopen if you send a gist to reproduce this! 👍 Thank you.
clue commentedon Oct 20, 2017
Ping @kelunik, I suppose this is still resolved? 👍
kelunik commentedon Oct 20, 2017
It's weird. If I try to look into it with
phpdbgand pause the execution and continue it again, the 100% CPU usage is gone. Seems to be a Heisenbug. Haven't found another reproduction case, because I'm not sure what causes it. So no, it's not resolved as stated previously. It's not the expected misbehavior that reactphp/child-process#51 might cause, as previously stated.clue commentedon Oct 20, 2017
@kelunik Thanks for trying to dig into this. If you happen to find a way to reproduce this, I'm happy to re-open this so we can look into this 👍
lajosbencz commentedon Jan 15, 2020
I've ran into this issue aswell, i'm installing
react/child-process:0.6.1from composer, and the default event loop (React\EventLoop\ExtUvLoop) consumes 100% of the CPU.If i explicitly set it to StreamSelectLoop, the process works as expected at around 5-10% CPU usage.
The project im using it in: https://github.com/lajosbencz/phrocman
Could it be purely related to the loop implementation, and nothing to do with the component itself?
clue commentedon Jan 15, 2020
@lajosbencz We're not aware of any such issues at the moment. Can you provide a minimal test script to reproduce this locally?
If this is related to spawning child-processes, can you take a look at one of the possible work-arounds for reactphp/child-process#51, such as clue/reactphp-sqlite#7?