Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
dd4256af
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,发现更多精彩内容 >>
提交
dd4256af
编写于
10月 12, 2015
作者:
C
christ66
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add more logging to Queue.maintain in order to understand why potential
builds could be blocked queue and never executed.
上级
e4811a1d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
4 deletion
+27
-4
core/src/main/java/hudson/model/Queue.java
core/src/main/java/hudson/model/Queue.java
+27
-4
未找到文件。
core/src/main/java/hudson/model/Queue.java
浏览文件 @
dd4256af
...
...
@@ -1385,9 +1385,13 @@ public class Queue extends ResourceController implements Saveable {
// we need to clear lost pendings as we cannot know what work unit was on this executor
// while it is interrupted. (All this dancing is a result of Executor extending Thread)
lostPendings
.
clear
();
// we'll get them next time around when the flag is cleared.
LOGGER
.
log
(
Level
.
FINEST
,
"Interrupt thread for executor {0} is set and we do not know what work unit was on the executor."
,
e
.
getDisplayName
());
continue
;
}
if
(
e
.
isParking
())
{
LOGGER
.
log
(
Level
.
FINEST
,
"{0} is parking and is waiting for a job to execute."
,
e
.
getDisplayName
());
parked
.
put
(
e
,
new
JobOffer
(
e
));
}
final
WorkUnit
workUnit
=
e
.
getCurrentWorkUnit
();
...
...
@@ -1419,7 +1423,12 @@ public class Queue extends ResourceController implements Saveable {
Collections
.
sort
(
blockedItems
,
QueueSorter
.
DEFAULT_BLOCKED_ITEM_COMPARATOR
);
}
for
(
BlockedItem
p
:
blockedItems
)
{
LOGGER
.
log
(
Level
.
FINER
,
"Current blocked item: {0}"
,
p
.
task
.
getFullDisplayName
());
if
(!
isBuildBlocked
(
p
)
&&
allowNewBuildableTask
(
p
.
task
))
{
LOGGER
.
log
(
Level
.
INFO
,
"BlockedItem {0}: blocked -> buildable as the build is not blocked and new tasks are allowed"
,
p
.
task
.
getFullDisplayName
());
// ready to be executed
Runnable
r
=
makeBuildable
(
new
BuildableItem
(
p
));
if
(
r
!=
null
)
{
...
...
@@ -1438,8 +1447,10 @@ public class Queue extends ResourceController implements Saveable {
while
(!
waitingList
.
isEmpty
())
{
WaitingItem
top
=
peek
();
if
(
top
.
timestamp
.
compareTo
(
new
GregorianCalendar
())
>
0
)
if
(
top
.
timestamp
.
compareTo
(
new
GregorianCalendar
())
>
0
)
{
LOGGER
.
log
(
Level
.
FINE
,
"Finished moving all ready items from queue."
);
break
;
// finished moving all ready items from queue
}
top
.
leave
(
this
);
Task
p
=
top
.
task
;
...
...
@@ -1447,8 +1458,10 @@ public class Queue extends ResourceController implements Saveable {
// ready to be executed immediately
Runnable
r
=
makeBuildable
(
new
BuildableItem
(
top
));
if
(
r
!=
null
)
{
LOGGER
.
log
(
Level
.
FINE
,
"Executing runnable {0}"
,
top
.
task
.
getFullDisplayName
());
r
.
run
();
}
else
{
LOGGER
.
log
(
Level
.
FINEST
,
"Item {0} was unable to be made a buildable and is now a blocked item."
,
top
.
task
.
getFullDisplayName
());
new
BlockedItem
(
top
).
enter
(
this
);
}
}
else
{
...
...
@@ -1482,15 +1495,19 @@ public class Queue extends ResourceController implements Saveable {
Runnable
r
=
makeFlyWeightTaskBuildable
(
new
BuildableItem
(
p
));
if
(
r
!=
null
)
{
p
.
leave
(
this
);
LOGGER
.
log
(
Level
.
FINEST
,
"Executing flyweight task {0}"
,
p
.
task
.
getFullDisplayName
());
r
.
run
();
updateSnapshot
();
}
}
else
{
List
<
JobOffer
>
candidates
=
new
ArrayList
<
JobOffer
>(
parked
.
size
());
for
(
JobOffer
j
:
parked
.
values
())
if
(
j
.
canTake
(
p
))
for
(
JobOffer
j
:
parked
.
values
())
{
if
(
j
.
canTake
(
p
))
{
LOGGER
.
log
(
Level
.
FINEST
,
"Potential candidate for "
);
candidates
.
add
(
j
);
}
}
MappingWorksheet
ws
=
new
MappingWorksheet
(
p
,
candidates
);
Mapping
m
=
loadBalancer
.
map
(
p
.
task
,
ws
);
...
...
@@ -1505,10 +1522,12 @@ public class Queue extends ResourceController implements Saveable {
// found a matching executor. use it.
WorkUnitContext
wuc
=
new
WorkUnitContext
(
p
);
LOGGER
.
log
(
Level
.
FINER
,
"Found a matching executor for {0}. Using it."
,
p
.
task
.
getFullDisplayName
());
m
.
execute
(
wuc
);
p
.
leave
(
this
);
if
(!
wuc
.
getWorkUnits
().
isEmpty
())
{
LOGGER
.
log
(
Level
.
FINE
,
"BuildableItem {0} marked as pending."
,
p
.
task
.
getFullDisplayName
());
makePending
(
p
);
}
else
...
...
@@ -1542,7 +1561,7 @@ public class Queue extends ResourceController implements Saveable {
if
(!
isBlockedByShutdown
(
p
.
task
))
{
Runnable
runnable
=
makeFlyWeightTaskBuildable
(
p
);
LOGGER
.
log
(
Level
.
FINE
,
"Converting flyweight task: {0} into a BuildableRunnable"
,
p
.
task
.
getFullDisplayName
());
if
(
runnable
!=
null
){
return
runnable
;
}
...
...
@@ -1551,9 +1570,11 @@ public class Queue extends ResourceController implements Saveable {
//if the execution gets here, it means the task could not be scheduled since the node
//the task is supposed to run on is offline or not available.
//Thus, the flyweighttask enters the buildables queue and will ask Jenkins to provision a node
LOGGER
.
log
(
Level
.
FINEST
,
"Flyweight task {0} is entering as buildable to provision a node."
,
p
.
task
.
getFullDisplayName
());
return
new
BuildableRunnable
(
p
);
}
// if the execution gets here, it means the task is blocked by shutdown and null is returned.
LOGGER
.
log
(
Level
.
FINE
,
"Task {0} is blocked by shutdown."
,
p
.
task
.
getFullDisplayName
());
return
null
;
}
else
{
// regular heavyweight task
...
...
@@ -1595,6 +1616,8 @@ public class Queue extends ResourceController implements Saveable {
if
(
n
.
canTake
(
p
)
!=
null
)
{
continue
;
}
LOGGER
.
log
(
Level
.
FINE
,
"Creating flyweight task {0} for machine {1}"
,
new
Object
[]{
p
.
task
,
c
.
getName
()});
return
new
Runnable
()
{
@Override
public
void
run
()
{
c
.
startFlyWeightTask
(
new
WorkUnitContext
(
p
).
createWorkUnit
(
p
.
task
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录