Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
9c7ef619
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,发现更多精彩内容 >>
提交
9c7ef619
编写于
7月 23, 2012
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FIXED JENKINS-13972]
Fixed a problem in actually making concurrent builds work.
上级
83c0a6f1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
41 addition
and
13 deletion
+41
-13
changelog.html
changelog.html
+3
-0
core/src/main/java/hudson/matrix/MatrixBuild.java
core/src/main/java/hudson/matrix/MatrixBuild.java
+8
-2
core/src/main/java/hudson/matrix/MatrixConfiguration.java
core/src/main/java/hudson/matrix/MatrixConfiguration.java
+30
-11
未找到文件。
changelog.html
浏览文件 @
9c7ef619
...
...
@@ -55,6 +55,9 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div
id=
"trunk"
style=
"display:none"
>
<!--=TRUNK-BEGIN=-->
<ul
class=
image
>
<li
class=
bug
>
Fixed a problem in the concurrent matrix build.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-13972"
>
issue 13972
</a>
)
<li
class=
rfe
>
Make the draggable component more obvious by providing a border.
<li
class=
rfe
>
...
...
core/src/main/java/hudson/matrix/MatrixBuild.java
浏览文件 @
9c7ef619
...
...
@@ -28,12 +28,14 @@ import hudson.AbortException;
import
hudson.Functions
;
import
hudson.Util
;
import
hudson.console.ModelHyperlinkNote
;
import
hudson.matrix.MatrixConfiguration.ParentBuildAction
;
import
hudson.model.AbstractBuild
;
import
hudson.model.AbstractProject
;
import
hudson.model.BuildListener
;
import
hudson.model.Executor
;
import
hudson.model.Fingerprint
;
import
hudson.model.Queue
;
import
hudson.model.Queue.Item
;
import
hudson.model.Result
;
import
hudson.util.HttpResponses
;
import
jenkins.model.Jenkins
;
...
...
@@ -350,8 +352,12 @@ public class MatrixBuild extends AbstractBuild<MatrixProject,MatrixBuild> {
synchronized
(
q
)
{
// avoid micro-locking in q.cancel.
final
int
n
=
getNumber
();
for
(
MatrixConfiguration
c
:
activeConfigurations
)
{
if
(
q
.
cancel
(
c
))
logger
.
println
(
Messages
.
MatrixBuild_Cancelled
(
ModelHyperlinkNote
.
encodeTo
(
c
)));
for
(
Item
i
:
q
.
getItems
(
c
))
{
if
(
i
.
getAction
(
ParentBuildAction
.
class
).
parent
==
getBuild
())
{
q
.
cancel
(
i
);
logger
.
println
(
Messages
.
MatrixBuild_Cancelled
(
ModelHyperlinkNote
.
encodeTo
(
c
)));
}
}
MatrixRun
b
=
c
.
getBuildByNumber
(
n
);
if
(
b
!=
null
&&
b
.
isBuilding
())
{
// executor can spend some time in post production state, so only cancel in-progress builds.
Executor
exe
=
b
.
getExecutor
();
...
...
core/src/main/java/hudson/matrix/MatrixConfiguration.java
浏览文件 @
9c7ef619
...
...
@@ -24,7 +24,10 @@
package
hudson.matrix
;
import
hudson.Util
;
import
hudson.remoting.LocalChannel
;
import
hudson.model.Action
;
import
hudson.model.Executor
;
import
hudson.model.InvisibleAction
;
import
hudson.model.Queue.QueueAction
;
import
hudson.util.AlternativeUiTextProvider
;
import
hudson.util.DescribableList
;
import
hudson.model.AbstractBuild
;
...
...
@@ -32,7 +35,6 @@ import hudson.model.Cause;
import
hudson.model.CauseAction
;
import
hudson.model.DependencyGraph
;
import
hudson.model.Descriptor
;
import
hudson.util.RemotingDiagnostics
;
import
jenkins.model.Jenkins
;
import
hudson.model.Item
;
import
hudson.model.ItemGroup
;
...
...
@@ -48,11 +50,8 @@ import hudson.tasks.BuildWrapper;
import
hudson.tasks.Builder
;
import
hudson.tasks.LogRotator
;
import
hudson.tasks.Publisher
;
import
jenkins.model.Jenkins.MasterComputer
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -127,12 +126,14 @@ public class MatrixConfiguration extends Project<MatrixConfiguration,MatrixRun>
*/
@Override
public
int
getNextBuildNumber
()
{
AbstractBuild
lb
=
getParent
().
getLastBuild
();
AbstractBuild
<?,?>
lb
=
getParent
().
getLastBuild
();
while
(
lb
!=
null
&&
lb
.
isBuilding
())
{
lb
=
lb
.
getPreviousBuild
();
}
if
(
lb
==
null
)
return
0
;
int
n
=
lb
.
getNumber
();
if
(!
lb
.
isBuilding
())
n
++;
int
n
=
lb
.
getNumber
()+
1
;
lb
=
getLastBuild
();
if
(
lb
!=
null
)
...
...
@@ -196,9 +197,17 @@ public class MatrixConfiguration extends Project<MatrixConfiguration,MatrixRun>
@Override
protected
MatrixRun
newBuild
()
throws
IOException
{
// for every MatrixRun there should be a parent MatrixBuild
List
<
Action
>
actions
=
Executor
.
currentExecutor
().
getCurrentWorkUnit
().
context
.
actions
;
MatrixBuild
lb
=
getParent
().
getLastBuild
();
for
(
Action
a
:
actions
)
{
if
(
a
instanceof
ParentBuildAction
)
{
lb
=
((
ParentBuildAction
)
a
).
parent
;
}
}
// for every MatrixRun there should be a parent MatrixBuild
MatrixRun
lastBuild
=
new
MatrixRun
(
this
,
lb
.
getTimestamp
());
lastBuild
.
number
=
lb
.
getNumber
();
builds
.
put
(
lastBuild
);
...
...
@@ -347,6 +356,16 @@ public class MatrixConfiguration extends Project<MatrixConfiguration,MatrixRun>
* Can be null.
*/
public
boolean
scheduleBuild
(
ParametersAction
parameters
,
Cause
c
)
{
return
Jenkins
.
getInstance
().
getQueue
().
schedule
(
this
,
getQuietPeriod
(),
parameters
,
new
CauseAction
(
c
))!=
null
;
return
Jenkins
.
getInstance
().
getQueue
().
schedule
(
this
,
getQuietPeriod
(),
parameters
,
new
CauseAction
(
c
),
new
ParentBuildAction
())!=
null
;
}
/**
*
*/
public
static
class
ParentBuildAction
extends
InvisibleAction
implements
QueueAction
{
public
transient
MatrixBuild
parent
=
(
MatrixBuild
)
Executor
.
currentExecutor
().
getCurrentExecutable
();
public
boolean
shouldSchedule
(
List
<
Action
>
actions
)
{
return
true
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录