-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command hangs forever after update from 1.2.2 to 1.2.3 #21
Comments
[Update] Source of the tested command: https://github.com/dmstr/yii2-db/blob/master/console/controllers/MysqlController.php#L232 |
@schmunk42 Ok, so the change suggested in #20 now introduces other problems. It seems, whichever way we do it, there's always a situation where the command can hang. And I want to avoid introducing more esotheric settings to make this configurable. Can we find a silver bullet that always works? CC: @leonardopcastro |
@schmunk42 @leonardopcastro The first thing we should do is write tests that reproduce the issues described here and in #20. Could you maybe help here? I personally never had an issue with hanging commands like this. |
I will try to isolate the problem in my configuration to check if it's OS related, PHP related, or if some other variable is influencing it. |
I managed to find out what is the situation that triggers the hanging error described in #20. It happens when using mikehaertl\wkhtmlto\Pdf class with a long html string. If you use the Pdf class with a file name, it is working as intended. I attached two sample files so you can reproduce the issue too. I changed the extension of them because Github would not allow me to attach the originals. At the end of the html file, you are going to find these numbers "12345678". If you erase one of them, the error message of the wkhtmltopdf will show up and the php will not hang. |
@leonardopcastro Hmm, ok thanks. To be honest I was hoping for a simpler test. We need to write an automated test case and pulling in our wkhtmltopdf library for this seems like overkill. It's also harder to really find the root of the problem. phpwkthmltopdf does a couple of things under the hood if you generate a PDF from a string. It would be great if we could reproduce the issue by using only standard shell commands like |
I'd try to reproduce the case mentioned, the file is around 61kB, maybe there's some sort of 64kB buffer somewhere causing this. @leonardopcastro Some full code including the initial php-shellcommand object would be helpful. |
Hmm, the current situation is somehow not ideal, since we have to pin the version of shellcommand to 1.2.2. Couldn't we make this configurable after all? Like |
I really want to avoid that. A setting like this implies, that the developers knows about the ugly internals of this class. We should not annoy our users with this. So for now I think you have to pin the version to |
I mean there are no other issues reported on either side, but concerning semantic versioning you should revert this in 1.2.4 and create a 1.3.0-beta1 until this is finally resolved. |
@schmunk42 I've released 1.2.4 which basically reverts the changes introduced in #20. Until we find a solution without breaking BC this should be the best option. I don't think it's neccessary to create 1.3.0 as our final goal should be, not to have any BC break at all. @leonardopcastro So it's now you who have to pin your version to 1.2.3 ;). Let's continue discussion in #20. Still interested in a simple test case for both problems. |
Hanging test: https://github.com/dmstr/phd5-app/blob/master/tests/codeception/cli/DbDumpCept.php
Output:
It's a rather simple DB-dump which takes <1s in the test setup.
Works fine after reverting to 1.2.2
The text was updated successfully, but these errors were encountered: