Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
14d17c55
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,发现更多精彩内容 >>
提交
14d17c55
编写于
12月 02, 2010
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FIXED HUDSON-8106] fixed an abstract error.
上级
1573ae80
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
12 deletion
+36
-12
changelog.html
changelog.html
+3
-0
core/src/main/java/hudson/model/Executor.java
core/src/main/java/hudson/model/Executor.java
+11
-11
core/src/main/java/hudson/model/Queue.java
core/src/main/java/hudson/model/Queue.java
+1
-1
core/src/main/java/hudson/model/queue/Executables.java
core/src/main/java/hudson/model/queue/Executables.java
+21
-0
未找到文件。
changelog.html
浏览文件 @
14d17c55
...
...
@@ -42,6 +42,9 @@ Upcoming changes</a>
<ul
class=
image
>
<li
class=
bug
>
Failure to UDP broadcast shouldn't kill the Hudson bootup process.
<li
class=
bug
>
Fixed an
<tt>
AbstractMethodError
</tt>
in listing up executors.
(
<a
href=
"http://issues.hudson-ci.org/browse/HUDSON-8106"
>
issue 8106
</a>
)
</ul>
</div>
<!--=TRUNK-END=-->
...
...
core/src/main/java/hudson/model/Executor.java
浏览文件 @
14d17c55
...
...
@@ -26,6 +26,7 @@ package hudson.model;
import
hudson.model.Queue.Executable
;
import
hudson.Util
;
import
hudson.FilePath
;
import
hudson.model.queue.Executables
;
import
hudson.model.queue.SubTask
;
import
hudson.model.queue.Tasks
;
import
hudson.model.queue.WorkUnit
;
...
...
@@ -269,7 +270,7 @@ public class Executor extends Thread implements ModelObject {
public
int
getProgress
()
{
Queue
.
Executable
e
=
executable
;
if
(
e
==
null
)
return
-
1
;
long
d
=
getEstimatedDurationFor
(
e
);
long
d
=
Executables
.
getEstimatedDurationFor
(
e
);
if
(
d
<
0
)
return
-
1
;
int
num
=
(
int
)(
getElapsedTime
()*
100
/
d
);
...
...
@@ -290,7 +291,7 @@ public class Executor extends Thread implements ModelObject {
if
(
e
==
null
)
return
false
;
long
elapsed
=
getElapsedTime
();
long
d
=
getEstimatedDurationFor
(
e
);
long
d
=
Executables
.
getEstimatedDurationFor
(
e
);
if
(
d
>=
0
)
{
// if it's taking 10 times longer than ETA, consider it stuck
return
d
*
10
<
elapsed
;
...
...
@@ -322,7 +323,7 @@ public class Executor extends Thread implements ModelObject {
Queue
.
Executable
e
=
executable
;
if
(
e
==
null
)
return
Messages
.
Executor_NotAvailable
();
long
d
=
getEstimatedDurationFor
(
e
);
long
d
=
Executables
.
getEstimatedDurationFor
(
e
);
if
(
d
<
0
)
return
Messages
.
Executor_NotAvailable
();
long
eta
=
d
-
getElapsedTime
();
...
...
@@ -339,7 +340,7 @@ public class Executor extends Thread implements ModelObject {
Queue
.
Executable
e
=
executable
;
if
(
e
==
null
)
return
-
1
;
long
d
=
getEstimatedDurationFor
(
e
);
long
d
=
Executables
.
getEstimatedDurationFor
(
e
);
if
(
d
<
0
)
return
-
1
;
long
eta
=
d
-
getElapsedTime
();
...
...
@@ -379,7 +380,7 @@ public class Executor extends Thread implements ModelObject {
if
(
isIdle
())
return
Math
.
max
(
finishTime
,
owner
.
getConnectTime
());
else
{
return
Math
.
max
(
startTime
+
Math
.
max
(
0
,
getEstimatedDurationFor
(
executable
)),
return
Math
.
max
(
startTime
+
Math
.
max
(
0
,
Executables
.
getEstimatedDurationFor
(
executable
)),
System
.
currentTimeMillis
()
+
15000
);
}
}
...
...
@@ -421,14 +422,13 @@ public class Executor extends Thread implements ModelObject {
/**
* Returns the estimated duration for the executable.
* Protects against {@link AbstractMethodError}s if the {@link Executable} implementation
* was compiled against Hudson < 1.383
* was compiled against Hudson < 1.383
*
* @deprecated as of 1.388
* Use {@link Executables#getEstimatedDurationFor(Executable)}
*/
public
static
long
getEstimatedDurationFor
(
Executable
e
)
{
try
{
return
e
.
getEstimatedDuration
();
}
catch
(
AbstractMethodError
error
)
{
return
e
.
getParent
().
getEstimatedDuration
();
}
return
Executables
.
getEstimatedDurationFor
(
e
);
}
/**
...
...
core/src/main/java/hudson/model/Queue.java
浏览文件 @
14d17c55
...
...
@@ -1116,7 +1116,7 @@ public class Queue extends ResourceController implements Saveable {
* Estimate of how long will it take to execute this executable.
* Measured in milliseconds.
*
* Please, consider using {@link Execut
or
#getEstimatedDurationFor(Executable)}
* Please, consider using {@link Execut
ables
#getEstimatedDurationFor(Executable)}
* to protected against AbstractMethodErrors!
*
* @return -1 if it's impossible to estimate.
...
...
core/src/main/java/hudson/model/queue/Executables.java
浏览文件 @
14d17c55
...
...
@@ -65,4 +65,25 @@ public class Executables {
private
static
SubTask
_getParentOf
(
Executable
e
)
{
return
e
.
getParent
();
}
/**
* Returns the estimated duration for the executable.
* Protects against {@link AbstractMethodError}s if the {@link Executable} implementation
* was compiled against Hudson < 1.383
*/
public
static
long
getEstimatedDurationFor
(
Executable
e
)
{
try
{
return
_getEstimatedDuration
(
e
);
}
catch
(
AbstractMethodError
error
)
{
return
e
.
getParent
().
getEstimatedDuration
();
}
}
/**
* A pointless function to work around what appears to be a HotSpot problem. See HUDSON-5756 and bug 6933067
* on BugParade for more details.
*/
private
static
long
_getEstimatedDuration
(
Executable
e
)
{
return
e
.
getEstimatedDuration
();
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录