热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

OptimizenpmInstallRetryTimeinBranch0.7

Thispullrequestaimstooptimizethenpminstallretrytimeinbranch0.7,reducingdelayscausedbylongtimeoutswhennonetworkconnectionisavailable.

Purpose of This Pull Request

This pull request targets branch 0.7 and addresses the issue of excessive delay during npm install when the machine is not connected to any network. The root cause is the lengthy retry timeout configured for npm install operations. This PR introduces a reduction in the retry timeout to mitigate these delays. It is related to the master branch PR: https://github.com/apache/zeppelin/pull/2095.

Type of Pull Request

Enhancement

Jira Issue

https://issues.apache.org/jira/browse/ZEPPELIN-2094

Testing Instructions

To test this change, you need to have at least one Helium visualization enabled. The specific changes can be found on line 221 of the file zeppelin-zengine/org.apache.zeppelin.helium.HeliumVisualizationFactory.java.

First, configure the npm install command as follows:

1
String commandForNpmInstall = "install --loglevel=error";

Then, disconnect from all network connections and perform a build and run operation.

Next, modify the command to include custom retry parameters:

1
2
3
4
String commandForNpmInstall =
String.format("install --fetch-retries=%d --fetch-retry-factor=%d "+
"--fetch-retry-mintimeout=%d",
FETCH_RETRY_COUNT, FETCH_RETRY_FACTOR_COUNT, FETCH_RETRY_MIN_TIMEOUT);

Again, ensure there is no network connection, and then build and run the application.

Additionally, perform the same steps on line 345, where an npm install operation for a specific artifact is executed.

Explanation of Parameters

The following table explains the impact of the changes made to the retry parameters:

DescriptionBeforeAfter
Conditionnpm's default settingsCustom settings
Random factorFalse = 1False = 1
Retry count22
Minimum timeout (sec)105
Maximum timeout (sec)6060
Factor101
First retry calculationMath.round(1 * 10 * 10^1)Math.round(1 * 5 * 1^1)
First retry result (approx.)100 sec5 sec
Second retry calculationMath.min(Math.round(1 * 10 * 10^2), 60)Math.min(Math.round(1 * 5 * 1^2), 60)
Second retry result (approx.)60 sec5 sec
Total waiting time (approx.)160 sec10 sec

These changes significantly reduce the total waiting time for npm install operations when no network is available.

Screenshots

Below are screenshots comparing the behavior before and after the changes:

BeforeAfter
Image placeholderImage placeholder

推荐阅读
  • 本文详细介绍了 org.apache.commons.io.IOCase 类中的 checkCompareTo() 方法,通过多个代码示例展示其在不同场景下的使用方法。 ... [详细]
  • ImmutableX Poised to Pioneer Web3 Gaming Revolution
    ImmutableX is set to spearhead the evolution of Web3 gaming, with its innovative technologies and strategic partnerships driving significant advancements in the industry. ... [详细]
  • 扫描线三巨头 hdu1928hdu 1255  hdu 1542 [POJ 1151]
    学习链接:http:blog.csdn.netlwt36articledetails48908031学习扫描线主要学习的是一种扫描的思想,后期可以求解很 ... [详细]
  • 本文详细介绍了 Java 中 org.apache.xmlbeans.SchemaType 类的 getBaseEnumType() 方法,提供了多个代码示例,并解释了其在不同场景下的使用方法。 ... [详细]
  • 本文详细介绍了Java中org.eclipse.ui.forms.widgets.ExpandableComposite类的addExpansionListener()方法,并提供了多个实际代码示例,帮助开发者更好地理解和使用该方法。这些示例来源于多个知名开源项目,具有很高的参考价值。 ... [详细]
  • 本文详细分析了Hive在启动过程中遇到的权限拒绝错误,并提供了多种解决方案,包括调整文件权限、用户组设置以及环境变量配置等。 ... [详细]
  • 本文详细介绍了macOS系统的核心组件,包括如何管理其安全特性——系统完整性保护(SIP),并探讨了不同版本的更新亮点。对于使用macOS系统的用户来说,了解这些信息有助于更好地管理和优化系统性能。 ... [详细]
  • 本文详细介绍了如何在ECharts中使用线性渐变色,通过echarts.graphic.LinearGradient方法实现。文章不仅提供了完整的代码示例,还解释了各个参数的具体含义及其应用场景。 ... [详细]
  • 基于KVM的SRIOV直通配置及性能测试
    SRIOV介绍、VF直通配置,以及包转发率性能测试小慢哥的原创文章,欢迎转载目录?1.SRIOV介绍?2.环境说明?3.开启SRIOV?4.生成VF?5.VF ... [详细]
  • dotnet 通过 Elmish.WPF 使用 F# 编写 WPF 应用
    本文来安利大家一个有趣而且强大的库,通过F#和C#混合编程编写WPF应用,可以在WPF中使用到F#强大的数据处理能力在GitHub上完全开源Elmis ... [详细]
  • 深入解析 Apache Shiro 安全框架架构
    本文详细介绍了 Apache Shiro,一个强大且灵活的开源安全框架。Shiro 专注于简化身份验证、授权、会话管理和加密等复杂的安全操作,使开发者能够更轻松地保护应用程序。其核心目标是提供易于使用和理解的API,同时确保高度的安全性和灵活性。 ... [详细]
  • FinOps 与 Serverless 的结合:破解云成本难题
    本文探讨了如何通过 FinOps 实践优化 Serverless 应用的成本管理,提出了首个 Serverless 函数总成本估计模型,并分享了多种有效的成本优化策略。 ... [详细]
  • 本文详细介绍了网络存储技术的基本概念、分类及应用场景。通过分析直连式存储(DAS)、网络附加存储(NAS)和存储区域网络(SAN)的特点,帮助读者理解不同存储方式的优势与局限性。 ... [详细]
  • 本文介绍了多个适用于用户界面设计的Canvas框架,帮助开发者选择最适合的工具。 ... [详细]
  • PHP 过滤器详解
    本文深入探讨了 PHP 中的过滤器机制,包括常见的 $_SERVER 变量、filter_has_var() 函数、filter_id() 函数、filter_input() 函数及其数组形式、filter_list() 函数以及 filter_var() 和其数组形式。同时,详细介绍了各种过滤器的用途和用法。 ... [详细]
author-avatar
odile微笑头
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有