-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
No Error Handling for forbidden socket connections / Amp should be optional #166
Comments
Thanks for reporting the issue! Amp is optional, do I didn't think there could be that kind of issue. Maybe we could either process in non-parallel when that happens but then it should be logged IMO. The files processing with PHP-Scoper is really slow, non parallelising this takes ages (easily x4 compilation time). Alternatively, we could bail out with a more graceful message and suggest to use that Unrelated, but you should be able to simplify your config to: compactors:
- Herrera\Box\Compactor\Json
- Herrera\Box\Compactor\Php
compression: GZ
output: build/puppet-enc.phar
git-commit: git_commit
git-version: git_version
git-tag: git_tag
chmod: '0755' Removing useless files like test files & dev dependencies is sorted out by Box. It avoids any extra faff on our end, same for xdebug which is disabled by Box and the autoloader which is optimised.
If you can dig a bit into it, share the repo or something that would be awesome. Box took 3min to process (including scoping!) 15k files and <10s without scoping when I tested it |
with as discussed in the chat i think showing a warning without a bailout with an autofallback to non-parallel is a good thing if a network connection could not be established. maybe an a solution for the amp problem also could be, to allow to configure it more, thread count, used ports, temp file location, ... |
To recap my thoughts on this:
I'm not against the idea, but also I would suggest it only if the previous points are not enough.
Like for the env: I'm not against the idea either, but I would really like that this would be the last resort to solve the issue. |
@c33s could you open an issue on Amp repo regarding this? I would like to reproduce it to be able to apply a graceful message as well but I can't figure out how yet |
the easierst way to test it for yourself is to install a strict firewall which disallows to open a port localy. shouldn't you only have to catch
should i? i am not sure what to write because i cannot really say if the problem is in how your app calls amp or if amp simply assume that all ports are open everywhere and everytime. i think the exception handling is the part of box, because amp works per definition with sockets and ports (i assume). so box should handle for the other stuff i will have to check the amp doc if it is possible or open a ticket at their repo:
or maybe @kelunik (hope i picked the right maintainer for amphp) has a little time to read through this issue and shares his opinion with us. |
I'm not sure which exception to catch yet because it depends on how the exceptions are intercepted and re-thrown.
Yes. The way Box consumes Amp can't be any simpler: |
oh forgot about the infinit loop xD |
@c33s Please open an issue at https://github.com/amphp/parallel for the infinite loop and https://github.com/amphp/process for the ports if you want. We need to open a port for IPC communication, because Windows doesn't support non-blocking operations for pipes, which are file handles on Windows. |
Closing in favour of #193 |
shouldn't this be reopend, is it really a windows only? isn't it also about allowing to enable/disable multi threading? |
|
Maybe that's also the case elsewhere, I do not know but no issue has been reported so far. But since parallelism is only used when there is PhpScoper and since there is the |
running
box
on a firewalled windows system where all connections are blocked by default for all processes. if i runbox build
i get screens of error messages (i try to put a symfony4 skeleton in a phar file).if i allow the php process to create a connection the errors are gone and box is building. in comparision to box 2 the amp part has the opposite of a speed increase. what box2 has build in 63sec box3 was not able to do in over 30min. had to terminate the process, the firewall was configured to allowed php to access the local dynamic port and also the temp file
ampCB1B.tmp
was allowed to connect.amp is a nice concept but it should be really optional, it has quite many side effects.
having to allow dynamic port access which i can't control was never i concept i liked. also having files in the temp dir, which are not firewalled is really uncool (need dynamic access). additional i have to bring my firewall in dialog mode every time i want to run box because the temp file is generated with a random name, so i have to create new rules for each file at each run.
please add a old school non-amp processing.
box.json.dist
Output
The text was updated successfully, but these errors were encountered: