Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
b1f0a7be
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
提交
b1f0a7be
编写于
4月 18, 2013
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adding more diagnostics logging
上级
7578aa93
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
3 deletion
+31
-3
core/src/main/java/hudson/model/Queue.java
core/src/main/java/hudson/model/Queue.java
+31
-3
未找到文件。
core/src/main/java/hudson/model/Queue.java
浏览文件 @
b1f0a7be
...
...
@@ -271,6 +271,11 @@ public class Queue extends ResourceController implements Saveable {
public
boolean
isNotExclusive
()
{
return
getNode
().
getMode
()
==
Mode
.
NORMAL
;
}
@Override
public
String
toString
()
{
return
String
.
format
(
"JobOffer[%s #%d]"
,
executor
.
getOwner
().
getName
(),
executor
.
getNumber
());
}
}
/**
...
...
@@ -1024,6 +1029,7 @@ public class Queue extends ResourceController implements Saveable {
if
(
isBuildBlocked
(
p
))
{
itr
.
remove
();
blockedProjects
.
put
(
p
.
task
,
new
BlockedItem
(
p
));
LOGGER
.
fine
(
String
.
format
(
"Catching that %s is blocked in the last minute"
,
p
));
continue
;
}
...
...
@@ -1034,11 +1040,16 @@ public class Queue extends ResourceController implements Saveable {
MappingWorksheet
ws
=
new
MappingWorksheet
(
p
,
candidates
);
Mapping
m
=
loadBalancer
.
map
(
p
.
task
,
ws
);
if
(
m
==
null
)
if
(
m
==
null
)
{
// if we couldn't find the executor that fits,
// just leave it in the buildables list and
// check if we can execute other projects
if
(
LOGGER
.
isLoggable
(
Level
.
FINER
))
{
LOGGER
.
finer
(
String
.
format
(
"Failed to map %s to executors. candidates=%s parked=%s"
,
p
,
candidates
,
parked
.
values
()));
}
continue
;
}
// found a matching executor. use it.
WorkUnitContext
wuc
=
new
WorkUnitContext
(
p
);
...
...
@@ -1046,7 +1057,9 @@ public class Queue extends ResourceController implements Saveable {
itr
.
remove
();
if
(!
wuc
.
getWorkUnits
().
isEmpty
())
pendings
.
add
(
p
);
makePending
(
p
);
else
LOGGER
.
fine
(
String
.
format
(
"BuildableItem %s with empty work units!?"
,
p
));
}
}
...
...
@@ -1070,7 +1083,7 @@ public class Queue extends ResourceController implements Saveable {
if
(
lbl
!=
null
&&
!
lbl
.
contains
(
n
))
continue
;
if
(
n
.
canTake
(
p
)
!=
null
)
continue
;
c
.
startFlyWeightTask
(
new
WorkUnitContext
(
p
).
createWorkUnit
(
p
.
task
));
pendings
.
add
(
p
);
makePending
(
p
);
return
;
}
// if the execution get here, it means we couldn't schedule it anywhere.
...
...
@@ -1080,6 +1093,11 @@ public class Queue extends ResourceController implements Saveable {
buildables
.
put
(
p
.
task
,
p
);
}
private
boolean
makePending
(
BuildableItem
p
)
{
p
.
isPending
=
true
;
return
pendings
.
add
(
p
);
}
public
static
boolean
ifBlockedByHudsonShutdown
(
Task
task
)
{
return
Jenkins
.
getInstance
().
isQuietingDown
()
&&
!(
task
instanceof
NonBlockingTask
);
}
...
...
@@ -1597,6 +1615,11 @@ public class Queue extends ResourceController implements Saveable {
* {@link Item} in the {@link Queue#buildables} stage.
*/
public
final
static
class
BuildableItem
extends
NotWaitingItem
{
/**
* Set to true when this is added to the {@link Queue#pendings} list.
*/
private
boolean
isPending
;
public
BuildableItem
(
WaitingItem
wi
)
{
super
(
wi
);
}
...
...
@@ -1662,6 +1685,11 @@ public class Queue extends ResourceController implements Saveable {
return
TimeUnit2
.
MILLISECONDS
.
toHours
(
elapsed
)>
24
;
}
}
@Exported
public
boolean
isPending
()
{
return
isPending
;
}
}
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
Queue
.
class
.
getName
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录