GitHub user NohSeho opened a pull request: https://github.com/apache/zeppelin/pull/2095
[ZEPPELIN-2094] Decrease npm install retry time (for branch-0.7) ### What is this PR for? **This pr is for branch-0.7** Itâs too delayed for npm install when computer do not connected any networks. Beacause when npm install, it has too long retry timeout. This PR is to decrease retry timeout when npm install. [pr for mater](https://github.com/apache/zeppelin/pull/2060) ### What type of PR is it? Improvement ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-2094 ### How should this be tested? you must enable any one helium before test Line 197 In zeppelin-zengine org.apache.zeppelin.helium.HeliumBundleFactory.java First set with `String npmCommand = "install âloglevel=errorâ;` and You donât connect any ethernet or wireless internet. build & run and set with `String npmCommand = "install âfetch-retries=2 âfetch-retry-factor=1 âfetch-retry-mintimeout=5000 âloglevel=errorâ;` also donât connect any networks, build & run. WHY retries = 2 factor = 1 mintimeout = 5(sec)? npm use [retry](https://github.com/tim-kos/node-retry) module to retry. It refers [this article](http://dthain.blogspot.kr/2009/02/exponential-backoff-in-distributed.html) for retry algorithms. It is a math which structured _Math.min(Math.round(random * minTimeout * Math.pow(factor, attempt)), maxTimeout)_. In retry source code, between two retries. First retry doesn't care _Math.min()_, just _Math.round(random * minTimeout * Math.pow(factor, attempt))_) Description | Before | After ------- | ------- | ------- Condition | npm's default setting<br>random = False = 1<br>retry = 2<br>minTimeout = 10 (sec)<br>maxTimeout = 60 (sec)<br>factor = 10 | custom setting<br>random = False = 1<br>retry = 2<br>minTimeout = 5 (sec)<br>maxTimeout = 60 (sec)<br>factor = 1<br> First retry | Math.round(1 * 10 (sec) * 10^1)) | Math.round(1 * 5 (sec) * 1^1)) First retry result (Approximately) | 100 (sec) | 5 (sec) Second retry | Math.min(Math.round(1 * 10 (sec) * 10^2), 60 (sec)) | Math.min(Math.round(1 * 5 (sec) * 1^2), 60 (sec)) Second retry result (Approximately) | 60 (sec) | 5 (sec) Total waiting time (Approximately) | 160 (sec) | 10 (sec) You can check like this below Screenshots. ### Screenshots Before | After -------|------- <img width="1077" alt="2017-02-24 12 32 06" src="https://cloud.githubusercontent.com/assets/1144643/23267951/9deaec6e-fa2f-11e6-9171-5792f24de76d.png"> | <img width="1081" alt="2017-02-24 12 37 10" src="https://cloud.githubusercontent.com/assets/1144643/23267954/a12c0c0a-fa2f-11e6-99cd-335deef607ac.png"> ### Questions: * Does the licenses files need update? N/A * Is there breaking changes for older versions? N/A * Does this needs documentation? N/A You can merge this pull request into a Git repository by running: $ git pull https://github.com/NohSeho/zeppelin ZEPPELIN-2094-for-0.7 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/zeppelin/pull/2095.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2095 ---- commit a9565ba4a96e719680284b39b08d0976aea73ea1 Author: NohSeho <i...@sehonoh.kr> Date: 2017-03-05T06:33:42Z [ZEPPELIN-2094] Decrease npm install retry time ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---