zend-patterns / ZendServerSDK

Pure ZF2 CLI for zpk creation and webapi client.
BSD 3-Clause "New" or "Revised" License
22 stars 17 forks source link

deployment timeout #83

Closed plmsprd closed 8 years ago

plmsprd commented 8 years ago

We are using cron jobs, will disable crond during deployment and wait until active cron jobs are finished before activating the deployment. Because of this, one deployment process could take 5 minutes or more. The deployment scripts on the server are fine (after adjusting Zend Server and PHP). However, zs client throws a timeout exception after around 3 minutes regardless of the setting for HTTP timeout, e.g.: --http=timeout=900 --http="timeout=560&sslverifypeer=0" The deployment scripts on the server continue to run after this exception.

We call zs client with --wait --safe.

The application has thrown an exception!

Exception The operation timed out!

slaff commented 8 years ago

Thank for pointing out this issue. The reason for it is in here: https://github.com/zend-patterns/ZendServerSDK/blob/master/module/Client/src/Client/Controller/Plugin/Repeater.php#L8. What we can do is use the http timeout, if it is set and is bigger than 180 sec, so that deployment works also for long running tasks

plmsprd commented 8 years ago

When will this be in regular zs-client.phar?


I created the phar myself and it worked, but I didn't have time to look into turning off those "deprecated" warnings:

Deprecated: ServiceLocatorAwareInterface is deprecated and will be removed in version 3.0, along with the ServiceLocatorAwareInitializer. Please update your class ZendServerWebApi\Model\ApiManager to remove the implementation, and start injecting your dependencies via factory instead. in phar:///usr/local/bin/zs-client/vendor/zendframework/zend-mvc/src/Service/ServiceManagerConfig.php on line 2

Deprecated: You are retrieving the service locator from within the class Client\Controller\ApiController. Please be aware that ServiceLocatorAwareInterface is deprecated and will be removed in version 3.0, along with the ServiceLocatorAwareInitializer. You will need to update your class to accept all dependencies at creation, either via constructor arguments or setters, and use a factory to perform the injections. in phar:///usr/local/bin/zs-client/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php on line 2

slaff commented 8 years ago

When will this be in regular zs-client.phar?

@plmsprd It is already there. (Make sure to update your local repository or download the latest phar file). Give it a try and tell us if it works for you.