Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
930f6308
J
jenkins
项目概览
LinuxSuRen
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
930f6308
编写于
5月 12, 2016
作者:
O
Oleg Nenashev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[JENKINS-34705] - Prevent hanging of InstallationWizard if internet check is skipped (#2328)
上级
d3b61b9c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
2 deletion
+19
-2
core/src/main/java/hudson/model/UpdateCenter.java
core/src/main/java/hudson/model/UpdateCenter.java
+10
-0
core/src/main/java/hudson/model/UpdateSite.java
core/src/main/java/hudson/model/UpdateSite.java
+3
-1
war/src/main/js/util/jenkins.js
war/src/main/js/util/jenkins.js
+6
-1
未找到文件。
core/src/main/java/hudson/model/UpdateCenter.java
浏览文件 @
930f6308
...
...
@@ -197,6 +197,12 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas
* Connection status has not started yet.
*/
PRECHECK
,
/**
* Connection status check has been skipped.
* As example, it may happen if there is no connection check URL defined for the site.
* @since TODO
*/
SKIPPED
,
/**
* Connection status is being checked at this time.
*/
...
...
@@ -1378,6 +1384,10 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas
connectionStates
.
put
(
ConnectionStatus
.
INTERNET
,
ConnectionStatus
.
OK
);
}
});
}
else
{
LOGGER
.
log
(
WARNING
,
"Update site '{0}' does not declare the connection check URL. "
+
"Skipping the network availability check."
,
site
.
getId
());
connectionStates
.
put
(
ConnectionStatus
.
INTERNET
,
ConnectionStatus
.
SKIPPED
);
}
connectionStates
.
put
(
ConnectionStatus
.
UPDATE_SITE
,
ConnectionStatus
.
CHECKING
);
...
...
core/src/main/java/hudson/model/UpdateSite.java
浏览文件 @
930f6308
...
...
@@ -341,9 +341,11 @@ public class UpdateSite {
}
/**
* Returns an "always up" server for Internet connectivity testing, or null if we are going to skip the test.
* Gets a URL for the Internet connection check.
* @return an "always up" server for Internet connectivity testing, or {@code null} if we are going to skip the test.
*/
@Exported
@CheckForNull
public
String
getConnectionCheckUrl
()
{
Data
dt
=
getData
();
if
(
dt
==
null
)
return
"http://www.google.com/"
;
...
...
war/src/main/js/util/jenkins.js
浏览文件 @
930f6308
...
...
@@ -200,12 +200,17 @@ exports.testConnectivity = function(siteId, handler) {
handler
(
false
,
true
,
response
.
message
);
}
// Define statuses, which need additional check iteration via async job on the Jenkins master
// Statuses like "OK" or "SKIPPED" are considered as fine.
var
uncheckedStatuses
=
[
'
PRECHECK
'
,
'
CHECKING
'
,
'
UNCHECKED
'
];
if
(
uncheckedStatuses
.
indexOf
(
response
.
data
.
updatesite
)
>=
0
||
uncheckedStatuses
.
indexOf
(
response
.
data
.
internet
)
>=
0
)
{
setTimeout
(
testConnectivity
,
100
);
}
else
{
if
(
response
.
status
!==
'
ok
'
||
response
.
data
.
updatesite
!==
'
OK
'
||
response
.
data
.
internet
!==
'
OK
'
)
{
// Update site should be always reachable, but we do not require the internet connection
// if it's explicitly skipped by the update center
if
(
response
.
status
!==
'
ok
'
||
response
.
data
.
updatesite
!==
'
OK
'
||
(
response
.
data
.
internet
!==
'
OK
'
&&
response
.
data
.
internet
!==
'
SKIPPED
'
))
{
// no connectivity, but not fatal
handler
(
false
,
false
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录