Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
320e6c07
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,发现更多精彩内容 >>
提交
320e6c07
编写于
1月 29, 2016
作者:
A
Antonio Muñiz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Slave to Agent renaming - Javadocs and logs
上级
079755c5
变更
77
隐藏空白更改
内联
并排
Showing
77 changed file
with
268 addition
and
268 deletion
+268
-268
core/src/main/java/hudson/EnvVars.java
core/src/main/java/hudson/EnvVars.java
+4
-4
core/src/main/java/hudson/FilePath.java
core/src/main/java/hudson/FilePath.java
+8
-8
core/src/main/java/hudson/FileSystemProvisioner.java
core/src/main/java/hudson/FileSystemProvisioner.java
+4
-4
core/src/main/java/hudson/FileSystemProvisionerDescriptor.java
...src/main/java/hudson/FileSystemProvisionerDescriptor.java
+2
-2
core/src/main/java/hudson/Functions.java
core/src/main/java/hudson/Functions.java
+1
-1
core/src/main/java/hudson/Launcher.java
core/src/main/java/hudson/Launcher.java
+2
-2
core/src/main/java/hudson/ProxyConfiguration.java
core/src/main/java/hudson/ProxyConfiguration.java
+2
-2
core/src/main/java/hudson/TcpSlaveAgentListener.java
core/src/main/java/hudson/TcpSlaveAgentListener.java
+6
-6
core/src/main/java/hudson/cli/OnlineNodeCommand.java
core/src/main/java/hudson/cli/OnlineNodeCommand.java
+1
-1
core/src/main/java/hudson/console/ConsoleLogFilter.java
core/src/main/java/hudson/console/ConsoleLogFilter.java
+2
-2
core/src/main/java/hudson/logging/LogRecorder.java
core/src/main/java/hudson/logging/LogRecorder.java
+2
-2
core/src/main/java/hudson/model/AbstractBuild.java
core/src/main/java/hudson/model/AbstractBuild.java
+5
-5
core/src/main/java/hudson/model/AbstractProject.java
core/src/main/java/hudson/model/AbstractProject.java
+7
-7
core/src/main/java/hudson/model/Computer.java
core/src/main/java/hudson/model/Computer.java
+19
-19
core/src/main/java/hudson/model/ComputerSet.java
core/src/main/java/hudson/model/ComputerSet.java
+6
-6
core/src/main/java/hudson/model/Hudson.java
core/src/main/java/hudson/model/Hudson.java
+2
-2
core/src/main/java/hudson/model/Label.java
core/src/main/java/hudson/model/Label.java
+2
-2
core/src/main/java/hudson/model/LoadStatistics.java
core/src/main/java/hudson/model/LoadStatistics.java
+3
-3
core/src/main/java/hudson/model/Node.java
core/src/main/java/hudson/model/Node.java
+7
-7
core/src/main/java/hudson/model/OverallLoadStatistics.java
core/src/main/java/hudson/model/OverallLoadStatistics.java
+1
-1
core/src/main/java/hudson/model/Queue.java
core/src/main/java/hudson/model/Queue.java
+1
-1
core/src/main/java/hudson/model/Result.java
core/src/main/java/hudson/model/Result.java
+1
-1
core/src/main/java/hudson/model/Run.java
core/src/main/java/hudson/model/Run.java
+1
-1
core/src/main/java/hudson/model/Slave.java
core/src/main/java/hudson/model/Slave.java
+11
-11
core/src/main/java/hudson/model/TaskListener.java
core/src/main/java/hudson/model/TaskListener.java
+1
-1
core/src/main/java/hudson/model/WorkspaceBrowser.java
core/src/main/java/hudson/model/WorkspaceBrowser.java
+2
-2
core/src/main/java/hudson/model/WorkspaceCleanupThread.java
core/src/main/java/hudson/model/WorkspaceCleanupThread.java
+1
-1
core/src/main/java/hudson/node_monitors/AbstractAsyncNodeMonitorDescriptor.java
...son/node_monitors/AbstractAsyncNodeMonitorDescriptor.java
+1
-1
core/src/main/java/hudson/node_monitors/ArchitectureMonitor.java
...c/main/java/hudson/node_monitors/ArchitectureMonitor.java
+1
-1
core/src/main/java/hudson/node_monitors/NodeMonitor.java
core/src/main/java/hudson/node_monitors/NodeMonitor.java
+2
-2
core/src/main/java/hudson/node_monitors/NodeMonitorUpdater.java
...rc/main/java/hudson/node_monitors/NodeMonitorUpdater.java
+2
-2
core/src/main/java/hudson/node_monitors/ResponseTimeMonitor.java
...c/main/java/hudson/node_monitors/ResponseTimeMonitor.java
+3
-3
core/src/main/java/hudson/os/solaris/ZFSProvisioner.java
core/src/main/java/hudson/os/solaris/ZFSProvisioner.java
+1
-1
core/src/main/java/hudson/scm/SCM.java
core/src/main/java/hudson/scm/SCM.java
+5
-5
core/src/main/java/hudson/slaves/AbstractCloudComputer.java
core/src/main/java/hudson/slaves/AbstractCloudComputer.java
+1
-1
core/src/main/java/hudson/slaves/AbstractCloudSlave.java
core/src/main/java/hudson/slaves/AbstractCloudSlave.java
+1
-1
core/src/main/java/hudson/slaves/ChannelPinger.java
core/src/main/java/hudson/slaves/ChannelPinger.java
+1
-1
core/src/main/java/hudson/slaves/Cloud.java
core/src/main/java/hudson/slaves/Cloud.java
+6
-6
core/src/main/java/hudson/slaves/CloudSlaveRetentionStrategy.java
.../main/java/hudson/slaves/CloudSlaveRetentionStrategy.java
+3
-3
core/src/main/java/hudson/slaves/CommandLauncher.java
core/src/main/java/hudson/slaves/CommandLauncher.java
+1
-1
core/src/main/java/hudson/slaves/ComputerLauncher.java
core/src/main/java/hudson/slaves/ComputerLauncher.java
+4
-4
core/src/main/java/hudson/slaves/ComputerListener.java
core/src/main/java/hudson/slaves/ComputerListener.java
+11
-11
core/src/main/java/hudson/slaves/ComputerRetentionWork.java
core/src/main/java/hudson/slaves/ComputerRetentionWork.java
+1
-1
core/src/main/java/hudson/slaves/ConnectionActivityMonitor.java
...rc/main/java/hudson/slaves/ConnectionActivityMonitor.java
+3
-3
core/src/main/java/hudson/slaves/EnvironmentVariablesNodeProperty.java
.../java/hudson/slaves/EnvironmentVariablesNodeProperty.java
+1
-1
core/src/main/java/hudson/slaves/JNLPLauncher.java
core/src/main/java/hudson/slaves/JNLPLauncher.java
+1
-1
core/src/main/java/hudson/slaves/NodeProperty.java
core/src/main/java/hudson/slaves/NodeProperty.java
+1
-1
core/src/main/java/hudson/slaves/NodeProvisioner.java
core/src/main/java/hudson/slaves/NodeProvisioner.java
+12
-12
core/src/main/java/hudson/slaves/RetentionStrategy.java
core/src/main/java/hudson/slaves/RetentionStrategy.java
+6
-6
core/src/main/java/hudson/slaves/SimpleScheduledRetentionStrategy.java
.../java/hudson/slaves/SimpleScheduledRetentionStrategy.java
+1
-1
core/src/main/java/hudson/slaves/SlaveComputer.java
core/src/main/java/hudson/slaves/SlaveComputer.java
+19
-19
core/src/main/java/hudson/tools/ToolInstallation.java
core/src/main/java/hudson/tools/ToolInstallation.java
+2
-2
core/src/main/java/hudson/tools/ToolInstaller.java
core/src/main/java/hudson/tools/ToolInstaller.java
+1
-1
core/src/main/java/hudson/util/ClockDifference.java
core/src/main/java/hudson/util/ClockDifference.java
+2
-2
core/src/main/java/hudson/util/ProcessKiller.java
core/src/main/java/hudson/util/ProcessKiller.java
+1
-1
core/src/main/java/hudson/util/RemotingDiagnostics.java
core/src/main/java/hudson/util/RemotingDiagnostics.java
+1
-1
core/src/main/java/jenkins/SlaveToMasterFileCallable.java
core/src/main/java/jenkins/SlaveToMasterFileCallable.java
+1
-1
core/src/main/java/jenkins/SoloFilePathFilter.java
core/src/main/java/jenkins/SoloFilePathFilter.java
+1
-1
core/src/main/java/jenkins/model/ArtifactManagerFactory.java
core/src/main/java/jenkins/model/ArtifactManagerFactory.java
+1
-1
core/src/main/java/jenkins/model/Jenkins.java
core/src/main/java/jenkins/model/Jenkins.java
+13
-13
core/src/main/java/jenkins/security/ChannelConfigurator.java
core/src/main/java/jenkins/security/ChannelConfigurator.java
+1
-1
core/src/main/java/jenkins/security/MasterToSlaveCallable.java
...src/main/java/jenkins/security/MasterToSlaveCallable.java
+1
-1
core/src/main/java/jenkins/security/Roles.java
core/src/main/java/jenkins/security/Roles.java
+4
-4
core/src/main/java/jenkins/security/SlaveToMasterCallable.java
...src/main/java/jenkins/security/SlaveToMasterCallable.java
+1
-1
core/src/main/java/jenkins/security/s2m/AdminCallableMonitor.java
.../main/java/jenkins/security/s2m/AdminCallableMonitor.java
+1
-1
core/src/main/java/jenkins/security/s2m/CallableDirectionChecker.java
...n/java/jenkins/security/s2m/CallableDirectionChecker.java
+2
-2
core/src/main/java/jenkins/security/s2m/DefaultFilePathFilter.java
...main/java/jenkins/security/s2m/DefaultFilePathFilter.java
+2
-2
core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java
...rc/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java
+5
-5
core/src/main/java/jenkins/slaves/EncryptedSlaveAgentJnlpFile.java
...main/java/jenkins/slaves/EncryptedSlaveAgentJnlpFile.java
+1
-1
core/src/main/java/jenkins/slaves/JnlpAgentReceiver.java
core/src/main/java/jenkins/slaves/JnlpAgentReceiver.java
+1
-1
core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol.java
.../src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol.java
+13
-13
core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol2.java
...src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol2.java
+2
-2
core/src/main/java/jenkins/slaves/JnlpSlaveHandshake.java
core/src/main/java/jenkins/slaves/JnlpSlaveHandshake.java
+2
-2
core/src/main/java/jenkins/slaves/WorkspaceLocator.java
core/src/main/java/jenkins/slaves/WorkspaceLocator.java
+4
-4
core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java
...jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java
+5
-5
core/src/main/java/jenkins/slaves/restarter/SlaveRestarter.java
...rc/main/java/jenkins/slaves/restarter/SlaveRestarter.java
+6
-6
core/src/main/java/jenkins/util/io/OnMaster.java
core/src/main/java/jenkins/util/io/OnMaster.java
+2
-2
未找到文件。
core/src/main/java/hudson/EnvVars.java
浏览文件 @
320e6c07
...
...
@@ -63,7 +63,7 @@ import java.util.logging.Logger;
*
* <p>
* In Jenkins, often we need to build up "environment variable overrides"
* on master, then to execute the process on
slave
s. This causes a problem
* on master, then to execute the process on
agent
s. This causes a problem
* when working with variables like <tt>PATH</tt>. So to make this work,
* we introduce a special convention <tt>PATH+FOO</tt> — all entries
* that starts with <tt>PATH+</tt> are merged and prepended to the inherited
...
...
@@ -134,7 +134,7 @@ public class EnvVars extends TreeMap<String,String> {
String
v
=
get
(
realKey
);
if
(
v
==
null
)
v
=
value
;
else
{
// we might be handling environment variables for a
slave
that can have different path separator
// we might be handling environment variables for a
agent
that can have different path separator
// than the master, so the following is an attempt to get it right.
// it's still more error prone that I'd like.
char
ch
=
platform
==
null
?
File
.
pathSeparatorChar
:
platform
.
pathSeparator
;
...
...
@@ -421,8 +421,8 @@ public class EnvVars extends TreeMap<String,String> {
* variables only when you access this from the master.
*
* <p>
* If you access this field from
slave
s, then this is the environment
* variable of the
slave
agent.
* If you access this field from
agent
s, then this is the environment
* variable of the
agent
agent.
*/
public
static
final
Map
<
String
,
String
>
masterEnvVars
=
initMaster
();
...
...
core/src/main/java/hudson/FilePath.java
浏览文件 @
320e6c07
...
...
@@ -127,7 +127,7 @@ import org.jenkinsci.remoting.RoleSensitive;
*
* <p>
* Unlike {@link File}, which always implies a file path on the current computer,
* {@link FilePath} represents a file path on a specific
slave
or the master.
* {@link FilePath} represents a file path on a specific
agent
or the master.
*
* Despite that, {@link FilePath} can be used much like {@link File}. It exposes
* a bunch of operations (and we should add more operations as long as they are
...
...
@@ -191,19 +191,19 @@ public final class FilePath implements Serializable {
/**
* When this {@link FilePath} represents the remote path,
* this field is always non-null on master (the field represents
* the channel to the remote
slave.) When transferred to a slave
via remoting,
* the channel to the remote
agent.) When transferred to a agent
via remoting,
* this field reverts back to null, since it's transient.
*
* When this {@link FilePath} represents a path on the master,
* this field is null on master. When transferred to a
slave
via remoting,
* this field is null on master. When transferred to a
agent
via remoting,
* this field becomes non-null, representing the {@link Channel}
* back to the master.
*
* This is used to determine whether we are running on the master or the
slave
.
* This is used to determine whether we are running on the master or the
agent
.
*/
private
transient
VirtualChannel
channel
;
// since the platform of the
slave
might be different, can't use java.io.File
// since the platform of the
agent
might be different, can't use java.io.File
private
final
String
remote
;
/**
...
...
@@ -259,7 +259,7 @@ public final class FilePath implements Serializable {
return
base
.
remote
+
'/'
+
rel
.
replace
(
'\\'
,
'/'
);
}
else
{
// need this replace, see Slave.getWorkspaceFor and AbstractItem.getFullName, nested jobs on Windows
//
slave
s will always have a rel containing at least one '/' character. JENKINS-13649
//
agent
s will always have a rel containing at least one '/' character. JENKINS-13649
return
base
.
remote
+
'\\'
+
rel
.
replace
(
'/'
,
'\\'
);
}
}
...
...
@@ -802,14 +802,14 @@ public final class FilePath implements Serializable {
listener
.
getLogger
().
println
(
message
);
if
(
isRemote
())
{
// First try to download from the
slave
machine.
// First try to download from the
agent
machine.
try
{
act
(
new
Unpack
(
archive
));
timestamp
.
touch
(
sourceTimestamp
);
return
true
;
}
catch
(
IOException
x
)
{
if
(
listener
!=
null
)
{
x
.
printStackTrace
(
listener
.
error
(
"Failed to download "
+
archive
+
" from
slave
; will retry from master"
));
x
.
printStackTrace
(
listener
.
error
(
"Failed to download "
+
archive
+
" from
agent
; will retry from master"
));
}
}
}
...
...
core/src/main/java/hudson/FileSystemProvisioner.java
浏览文件 @
320e6c07
...
...
@@ -51,7 +51,7 @@ import java.io.OutputStream;
* STILL A WORK IN PROGRESS. SUBJECT TO CHANGE! DO NOT EXTEND.
*
* TODO: is this per {@link Computer}? Per {@link Job}?
* -> probably per
slave
.
* -> probably per
agent
.
*
* <h2>Design Problems</h2>
* <ol>
...
...
@@ -71,7 +71,7 @@ import java.io.OutputStream;
* one more configuration option. It's especially tricky because
* during the configuration we don't know the OS type.
*
* OTOH special
slave
type like the ones for network.com grid can
* OTOH special
agent
type like the ones for network.com grid can
* hide this.
* </ol>
*
...
...
@@ -80,8 +80,8 @@ import java.io.OutputStream;
*
* To recap,
*
* - when a
slave
connects, we auto-detect the file system provisioner.
* (for example, ZFS FSP would check the
slave
root user prop
* - when a
n agent
connects, we auto-detect the file system provisioner.
* (for example, ZFS FSP would check the
agent
root user prop
* and/or attempt to "pfexec zfs create" and take over.)
*
* - the user may configure jobs for snapshot collection, along with
...
...
core/src/main/java/hudson/FileSystemProvisionerDescriptor.java
浏览文件 @
320e6c07
...
...
@@ -38,9 +38,9 @@ public abstract class FileSystemProvisionerDescriptor extends Descriptor<FileSys
* Called to clean up a workspace that may potentially belong to this {@link FileSystemProvisioner}.
*
* <p>
* Because users may modify the file system behind Hudson, and
slave
s may come and go when
* Because users may modify the file system behind Hudson, and
agent
s may come and go when
* configuration changes happen, in general case Hudson is unable to keep track of which jobs
* have workspaces in which
slave
s.
* have workspaces in which
agent
s.
*
* <p>
* So instead we rey on a garbage collection mechanism, to look at workspaces left in the file system
...
...
core/src/main/java/hudson/Functions.java
浏览文件 @
320e6c07
...
...
@@ -1575,7 +1575,7 @@ public class Functions {
* Obtains the host name of the Hudson server that clients can use to talk back to.
* <p>
* This is primarily used in <tt>slave-agent.jnlp.jelly</tt> to specify the destination
* that the
slave
s talk to.
* that the
agent
s talk to.
*/
public
String
getServerName
()
{
// Try to infer this from the configured root URL.
...
...
core/src/main/java/hudson/Launcher.java
浏览文件 @
320e6c07
...
...
@@ -297,7 +297,7 @@ public abstract class Launcher {
*
* <p>
* In adition to what the current process
* is inherited (if this is going to be launched from a
slave
agent, that
* is inherited (if this is going to be launched from a
agent
agent, that
* becomes the "current" process), these variables will be also set.
*/
public
ProcStarter
envs
(
Map
<
String
,
String
>
overrides
)
{
...
...
@@ -611,7 +611,7 @@ public abstract class Launcher {
* from the current process
* @param envVars
* Environment variable overrides. In addition to what the current process
* is inherited (if this is going to be launched from a
slave
agent, that
* is inherited (if this is going to be launched from a
n
agent, that
* becomes the "current" process), these variables will be also set.
*/
public
abstract
Channel
launchChannel
(
String
[]
cmd
,
OutputStream
out
,
FilePath
workDir
,
Map
<
String
,
String
>
envVars
)
throws
IOException
,
InterruptedException
;
...
...
core/src/main/java/hudson/ProxyConfiguration.java
浏览文件 @
320e6c07
...
...
@@ -215,7 +215,7 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
* This method should be used wherever {@link URL#openConnection()} to internet URLs is invoked directly.
*/
public
static
URLConnection
open
(
URL
url
)
throws
IOException
{
Jenkins
h
=
Jenkins
.
getInstance
();
// this code might run on
slave
s
Jenkins
h
=
Jenkins
.
getInstance
();
// this code might run on
agent
s
ProxyConfiguration
p
=
h
!=
null
?
h
.
proxy
:
null
;
if
(
p
==
null
)
return
url
.
openConnection
();
...
...
@@ -241,7 +241,7 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
}
public
static
InputStream
getInputStream
(
URL
url
)
throws
IOException
{
Jenkins
h
=
Jenkins
.
getInstance
();
// this code might run on
slave
s
Jenkins
h
=
Jenkins
.
getInstance
();
// this code might run on
agent
s
final
ProxyConfiguration
p
=
(
h
!=
null
)
?
h
.
proxy
:
null
;
if
(
p
==
null
)
return
new
RetryableHttpStream
(
url
);
...
...
core/src/main/java/hudson/TcpSlaveAgentListener.java
浏览文件 @
320e6c07
...
...
@@ -39,11 +39,11 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
/**
* Listens to incoming TCP connections from JNLP
slave
agents and CLI.
* Listens to incoming TCP connections from JNLP agents and CLI.
*
* <p>
* Aside from the HTTP endpoint, Jenkins runs {@link TcpSlaveAgentListener} that listens on a TCP socket.
* Historically this was used for inbound connection from
slave
agents (hence the name), but over time
* Historically this was used for inbound connection from agents (hence the name), but over time
* it was extended and made generic, so that multiple protocols of different purposes can co-exist on the
* same socket.
*
...
...
@@ -66,7 +66,7 @@ public final class TcpSlaveAgentListener extends Thread {
* Use 0 to choose a random port.
*/
public
TcpSlaveAgentListener
(
int
port
)
throws
IOException
{
super
(
"TCP
slave
agent listener port="
+
port
);
super
(
"TCP agent listener port="
+
port
);
try
{
serverSocket
=
ServerSocketChannel
.
open
();
serverSocket
.
socket
().
bind
(
new
InetSocketAddress
(
port
));
...
...
@@ -75,7 +75,7 @@ public final class TcpSlaveAgentListener extends Thread {
}
this
.
configuredPort
=
port
;
LOGGER
.
log
(
Level
.
FINE
,
"JNLP
slave
agent listener started on TCP port {0}"
,
getPort
());
LOGGER
.
log
(
Level
.
FINE
,
"JNLP agent listener started on TCP port {0}"
,
getPort
());
start
();
}
...
...
@@ -105,7 +105,7 @@ public final class TcpSlaveAgentListener extends Thread {
}
}
catch
(
IOException
e
)
{
if
(!
shuttingDown
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
"Failed to accept JNLP
slave
agent connections"
,
e
);
LOGGER
.
log
(
Level
.
SEVERE
,
"Failed to accept JNLP agent connections"
,
e
);
}
}
}
...
...
@@ -134,7 +134,7 @@ public final class TcpSlaveAgentListener extends Thread {
synchronized
(
getClass
())
{
id
=
iotaGen
++;
}
setName
(
"TCP
slave
agent connection handler #"
+
id
+
" with "
+
s
.
getRemoteSocketAddress
());
setName
(
"TCP agent connection handler #"
+
id
+
" with "
+
s
.
getRemoteSocketAddress
());
}
@Override
...
...
core/src/main/java/hudson/cli/OnlineNodeCommand.java
浏览文件 @
320e6c07
...
...
@@ -40,7 +40,7 @@ import java.util.logging.Logger;
@Extension
public
class
OnlineNodeCommand
extends
CLICommand
{
@Argument
(
metaVar
=
"NAME"
,
usage
=
"
Slave
name, or empty string for master"
)
@Argument
(
metaVar
=
"NAME"
,
usage
=
"
Agent
name, or empty string for master"
)
public
String
computerName
;
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
OnlineNodeCommand
.
class
.
getName
());
...
...
core/src/main/java/hudson/console/ConsoleLogFilter.java
浏览文件 @
320e6c07
...
...
@@ -88,10 +88,10 @@ public abstract class ConsoleLogFilter implements ExtensionPoint {
}
/**
* Called to decorate logger for master/
slave
communication.
* Called to decorate logger for master/
agent
communication.
*
* @param computer
*
Slave
computer for which the logger is getting decorated. Useful to do
*
Agent
computer for which the logger is getting decorated. Useful to do
* contextual decoration.
* @since 1.632
*/
...
...
core/src/main/java/hudson/logging/LogRecorder.java
浏览文件 @
320e6c07
...
...
@@ -208,7 +208,7 @@ public class LogRecorder extends AbstractModelObject implements Saveable {
}
private
static
final
class
SetLevel
extends
MasterToSlaveCallable
<
Void
,
Error
>
{
/** known loggers (kept per
slave
), to avoid GC */
/** known loggers (kept per
agent
), to avoid GC */
@SuppressWarnings
(
"MismatchedQueryAndUpdateOfCollection"
)
private
static
final
Set
<
Logger
>
loggers
=
new
HashSet
<
Logger
>();
private
final
String
name
;
private
final
Level
level
;
...
...
@@ -363,7 +363,7 @@ public class LogRecorder extends AbstractModelObject implements Saveable {
}
/**
* Gets a view of log records per
slave
matching this recorder.
* Gets a view of log records per
agent
matching this recorder.
* @return a map (sorted by display name) from computer to (nonempty) list of log records
* @since 1.519
*/
...
...
core/src/main/java/hudson/model/AbstractBuild.java
浏览文件 @
320e6c07
...
...
@@ -109,7 +109,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
private
static
final
boolean
upstreamCulprits
=
Boolean
.
getBoolean
(
"hudson.upstreamCulprits"
);
/**
* Name of the
slave
this project was built on.
* Name of the
agent
this project was built on.
* Null or "" if built by the master. (null happens when we read old record that didn't have this information.)
*/
private
String
builtOn
;
...
...
@@ -205,7 +205,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
* Returns a {@link Slave} on which this build was done.
*
* @return
* null, for example if the
slave
that this build run no longer exists.
* null, for example if the
agent
that this build run no longer exists.
*/
public
@CheckForNull
Node
getBuiltOn
()
{
if
(
builtOn
==
null
||
builtOn
.
equals
(
""
))
...
...
@@ -215,7 +215,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
}
/**
* Returns the name of the
slave
it was built on; null or "" if built by the master.
* Returns the name of the
agent
it was built on; null or "" if built by the master.
* (null happens when we read old record that didn't have this information.)
*/
@Exported
(
name
=
"builtOn"
)
...
...
@@ -276,7 +276,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
* {@link AbstractBuildExecution#decideWorkspace(Node,WorkspaceList)}.
*
* @return
* null if the workspace is on a
slave
that's not connected. Note that once the build is completed,
* null if the workspace is on a
n agent
that's not connected. Note that once the build is completed,
* the workspace may be used to build something else, so the value returned from this method may
* no longer show a workspace as it was used for this build.
* @since 1.319
...
...
@@ -808,7 +808,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
private
void
reportBrokenChannel
(
BuildListener
listener
)
throws
IOException
{
final
Node
node
=
getCurrentNode
();
listener
.
hyperlink
(
"/"
+
node
.
toComputer
().
getUrl
()
+
"log"
,
"
Slave
went offline during the build"
);
listener
.
hyperlink
(
"/"
+
node
.
toComputer
().
getUrl
()
+
"log"
,
"
Agent
went offline during the build"
);
listener
.
getLogger
().
println
();
final
OfflineCause
offlineCause
=
node
.
toComputer
().
getOfflineCause
();
if
(
offlineCause
!=
null
)
{
...
...
core/src/main/java/hudson/model/AbstractProject.java
浏览文件 @
320e6c07
...
...
@@ -270,7 +270,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
final
Jenkins
j
=
Jenkins
.
getInstance
();
final
List
<
Node
>
nodes
=
j
!=
null
?
j
.
getNodes
()
:
null
;
if
(
nodes
!=
null
&&
!
nodes
.
isEmpty
())
{
// if a new job is configured with Hudson that already has
slave
nodes
// if a new job is configured with Hudson that already has
agent
nodes
// make it roamable by default
canRoam
=
true
;
}
...
...
@@ -409,7 +409,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
/**
* Set of labels relevant to this job.
*
* This method is used to determine what
slave
s are relevant to jobs, for example by {@link View}s.
* This method is used to determine what
agent
s are relevant to jobs, for example by {@link View}s.
* It does not affect the scheduling. This information is informational and the best-effort basis.
*
* @since 1.456
...
...
@@ -502,7 +502,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
* Gets the directory where the module is checked out.
*
* @return
* null if the workspace is on a
slave
that's not connected.
* null if the workspace is on a
n agent
that's not connected.
* @deprecated as of 1.319
* To support concurrent builds of the same project, this method is moved to {@link AbstractBuild}.
* For backward compatibility, this method returns the right {@link AbstractBuild#getWorkspace()} if called
...
...
@@ -1268,7 +1268,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
try
{
workspace
.
mkdirs
();
}
catch
(
IOException
e
)
{
// Can't create workspace dir - Is
slave
disk full ?
// Can't create workspace dir - Is
agent
disk full ?
new
DiskSpaceMonitor
().
markNodeOfflineIfDiskspaceIsTooLow
(
build
.
getBuiltOn
().
toComputer
());
throw
e
;
}
...
...
@@ -1402,7 +1402,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
// At this point we start thinking about triggering a build just to get a workspace,
// because otherwise there's no way we can detect changes.
// However, first there are some conditions in which we do not want to do so.
// give time for
slave
s to come online if we are right after reconnection (JENKINS-8408)
// give time for
agent
s to come online if we are right after reconnection (JENKINS-8408)
long
running
=
Jenkins
.
getInstance
().
getInjector
().
getInstance
(
Uptime
.
class
).
getUptime
();
long
remaining
=
TimeUnit2
.
MINUTES
.
toMillis
(
10
)-
running
;
if
(
remaining
>
0
&&
/* this logic breaks tests of polling */
!
Functions
.
getIsUnitTest
())
{
...
...
@@ -1411,7 +1411,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
return
NO_CHANGES
;
}
// Do not trigger build, if no suitable
slave
is online
// Do not trigger build, if no suitable
agent
is online
if
(
workspaceOfflineReason
.
equals
(
WorkspaceOfflineReason
.
all_suitable_nodes_are_offline
))
{
// No suitable executor is online
listener
.
getLogger
().
print
(
Messages
.
AbstractProject_AwaitingWorkspaceToComeOnline
(
running
/
1000
));
...
...
@@ -1422,7 +1422,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
Label
label
=
getAssignedLabel
();
if
(
label
!=
null
&&
label
.
isSelfLabel
())
{
// if the build is fixed on a node, then attempting a build will do us
// no good. We should just wait for the
slave
to come back.
// no good. We should just wait for the
agent
to come back.
listener
.
getLogger
().
print
(
Messages
.
AbstractProject_NoWorkspace
());
listener
.
getLogger
().
println
(
" ("
+
workspaceOfflineReason
.
name
()
+
")"
);
return
NO_CHANGES
;
...
...
core/src/main/java/hudson/model/Computer.java
浏览文件 @
320e6c07
...
...
@@ -284,7 +284,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
}
/**
* Directory where rotated
slave
logs are stored.
* Directory where rotated
agent
logs are stored.
*
* The method also creates a log directory if required.
*
...
...
@@ -293,7 +293,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
protected
@Nonnull
File
getLogDir
()
{
File
dir
=
new
File
(
Jenkins
.
getInstance
().
getRootDir
(),
"logs/slaves/"
+
nodeName
);
if
(!
dir
.
exists
()
&&
!
dir
.
mkdirs
())
{
LOGGER
.
severe
(
"Failed to create
slave
log directory "
+
dir
.
getAbsolutePath
());
LOGGER
.
severe
(
"Failed to create
agent
log directory "
+
dir
.
getAbsolutePath
());
}
return
dir
;
}
...
...
@@ -306,7 +306,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
}
/**
* Gets the string representation of the
slave
log.
* Gets the string representation of the
agent
log.
*/
public
String
getLog
()
throws
IOException
{
return
Util
.
loadFile
(
getLogFile
());
...
...
@@ -383,12 +383,12 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
public
abstract
Charset
getDefaultCharset
();
/**
* Gets the logs recorded by this
slave
.
* Gets the logs recorded by this
agent
.
*/
public
abstract
List
<
LogRecord
>
getLogRecords
()
throws
IOException
,
InterruptedException
;
/**
* If {@link #getChannel()}==null, attempts to relaunch the
slave
agent.
* If {@link #getChannel()}==null, attempts to relaunch the agent.
*/
public
abstract
void
doLaunchSlaveAgent
(
StaplerRequest
req
,
StaplerResponse
rsp
)
throws
IOException
,
ServletException
;
...
...
@@ -618,8 +618,8 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
}
/**
* This method is called to determine whether manual launching of the
slave
is allowed at this point in time.
* @return {@code true} if manual launching of the
slave
is allowed at this point in time.
* This method is called to determine whether manual launching of the
agent
is allowed at this point in time.
* @return {@code true} if manual launching of the
agent
is allowed at this point in time.
*/
@Exported
public
boolean
isManualLaunchAllowed
()
{
...
...
@@ -647,8 +647,8 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
* Returns true if this computer can be launched by Hudson proactively and automatically.
*
* <p>
* For example, JNLP
slave
s return {@code false} from this, because the launch process
* needs to be initiated from the
slave
side.
* For example, JNLP
agent
s return {@code false} from this, because the launch process
* needs to be initiated from the
agent
side.
*/
@Exported
public
boolean
isLaunchSupported
()
{
...
...
@@ -661,7 +661,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
* <p>
* In contrast, {@link #isOffline()} represents the actual online/offline
* state. For example, this method may return false while {@link #isOffline()}
* returns true if the
slave
agent failed to launch.
* returns true if the agent failed to launch.
*
* @deprecated
* You should almost always want {@link #isOffline()}.
...
...
@@ -1142,7 +1142,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
}
/**
* Gets the thread dump of the
slave
JVM.
* Gets the thread dump of the
agent
JVM.
* @return
* key is the thread name, and the value is the pre-formatted dump.
*/
...
...
@@ -1161,14 +1161,14 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
* This method tries to compute the name of the host that's reachable by all the other nodes.
*
* <p>
* Since it's possible that the
slave
is not reachable from the master (it may be behind a firewall,
* Since it's possible that the
agent
is not reachable from the master (it may be behind a firewall,
* connecting to master via JNLP), this method may return null.
*
* It's surprisingly tricky for a machine to know a name that other systems can get to,
* especially between things like DNS search suffix, the hosts file, and YP.
*
* <p>
* So the technique here is to compute possible interfaces and names on the
slave
,
* So the technique here is to compute possible interfaces and names on the
agent
,
* then try to ping them from the master, and pick the one that worked.
*
* <p>
...
...
@@ -1177,7 +1177,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
* @since 1.300
* @return
* null if the host name cannot be computed (for example because this computer is offline,
* because the
slave
is behind the firewall, etc.)
* because the
agent
is behind the firewall, etc.)
*/
public
String
getHostName
()
throws
IOException
,
InterruptedException
{
if
(
hostNameCached
)
...
...
@@ -1339,7 +1339,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
if
(
vc
instanceof
Channel
)
{
w
.
println
(
"Master to slave"
);
((
Channel
)
vc
).
dumpExportTable
(
w
);
w
.
flush
();
// flush here once so that even if the dump from the
slave
fails, the client gets some useful info
w
.
flush
();
// flush here once so that even if the dump from the
agent
fails, the client gets some useful info
w
.
println
(
"\n\n\nSlave to master"
);
w
.
print
(
vc
.
call
(
new
DumpExportTableTask
()));
...
...
@@ -1446,7 +1446,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
Node
node
=
getNode
();
int
i
=
(
node
!=
null
)
?
nodes
.
indexOf
(
node
)
:
-
1
;
if
(
i
<
0
)
{
throw
new
IOException
(
"This
slave
appears to be removed while you were editing the configuration"
);
throw
new
IOException
(
"This
agent
appears to be removed while you were editing the configuration"
);
}
nodes
.
set
(
i
,
newNode
);
app
.
setNodes
(
nodes
);
...
...
@@ -1467,7 +1467,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
}
/**
* Really deletes the
slave
.
* Really deletes the
agent
.
*/
@RequirePOST
public
HttpResponse
doDoDelete
()
throws
IOException
{
...
...
@@ -1520,7 +1520,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
}
/**
* Returns {@code true} if the computer is accepting tasks. Needed to allow
slave
s programmatic suspension of task
* Returns {@code true} if the computer is accepting tasks. Needed to allow
agent
s programmatic suspension of task
* scheduling that does not overlap with being offline.
*
* @return {@code true} if the computer is accepting tasks
...
...
@@ -1538,7 +1538,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
*/
@CLIResolver
public
static
Computer
resolveForCLI
(
@Argument
(
required
=
true
,
metaVar
=
"NAME"
,
usage
=
"
Slave
name, or empty string for master"
)
String
name
)
throws
CmdLineException
{
@Argument
(
required
=
true
,
metaVar
=
"NAME"
,
usage
=
"
Agent
name, or empty string for master"
)
String
name
)
throws
CmdLineException
{
Jenkins
h
=
Jenkins
.
getInstance
();
Computer
item
=
h
.
getComputer
(
name
);
if
(
item
==
null
)
{
...
...
core/src/main/java/hudson/model/ComputerSet.java
浏览文件 @
320e6c07
...
...
@@ -137,7 +137,7 @@ public final class ComputerSet extends AbstractModelObject implements Describabl
}
/**
* Gets all the
slave
names.
* Gets all the
agent
names.
*/
public
List
<
String
>
get_slaveNames
()
{
return
new
AbstractList
<
String
>()
{
...
...
@@ -229,7 +229,7 @@ public final class ComputerSet extends AbstractModelObject implements Describabl
}
/**
* First check point in creating a new
slave
.
* First check point in creating a new
agent
.
*/
public
synchronized
void
doCreateItem
(
StaplerRequest
req
,
StaplerResponse
rsp
,
@QueryParameter
String
name
,
@QueryParameter
String
mode
,
...
...
@@ -278,7 +278,7 @@ public final class ComputerSet extends AbstractModelObject implements Describabl
}
/**
* Really creates a new
slave
.
* Really creates a new
agent
.
*/
public
synchronized
void
doDoCreateItem
(
StaplerRequest
req
,
StaplerResponse
rsp
,
@QueryParameter
String
name
,
...
...
@@ -295,12 +295,12 @@ public final class ComputerSet extends AbstractModelObject implements Describabl
Node
result
=
NodeDescriptor
.
all
().
find
(
type
).
newInstance
(
req
,
formData
);
app
.
addNode
(
result
);
// take the user back to the
slave
list top page
// take the user back to the
agent
list top page
rsp
.
sendRedirect2
(
"."
);
}
/**
* Makes sure that the given name is good as a
slave
name.
* Makes sure that the given name is good as a
n agent
name.
* @return trimmed name if valid; throws ParseException if not
*/
public
String
checkName
(
String
name
)
throws
Failure
{
...
...
@@ -318,7 +318,7 @@ public final class ComputerSet extends AbstractModelObject implements Describabl
}
/**
* Makes sure that the given name is good as a
slave
name.
* Makes sure that the given name is good as a
n agent
name.
*/
public
FormValidation
doCheckName
(
@QueryParameter
String
value
)
throws
IOException
,
ServletException
{
Jenkins
.
getInstance
().
checkPermission
(
Computer
.
CREATE
);
...
...
core/src/main/java/hudson/model/Hudson.java
浏览文件 @
320e6c07
...
...
@@ -106,7 +106,7 @@ public class Hudson extends Jenkins {
}
/**
* Gets the
slave node
of the give name, hooked under this Hudson.
* Gets the
agent
of the give name, hooked under this Hudson.
*
* @deprecated
* Use {@link #getNode(String)}. Since 1.252.
...
...
@@ -129,7 +129,7 @@ public class Hudson extends Jenkins {
}
/**
* Updates the
slave
list.
* Updates the
agent
list.
*
* @deprecated
* Use {@link #setNodes(List)}. Since 1.252.
...
...
core/src/main/java/hudson/model/Label.java
浏览文件 @
320e6c07
...
...
@@ -237,8 +237,8 @@ public abstract class Label extends Actionable implements Comparable<Label>, Mod
* <p>
* The answer is yes if there is a reasonable basis to believe that Hudson can have
* an executor under this label, given the current configuration. This includes
* situations such as (1) there are offline
slave
s that have this label (2) clouds exist
* that can provision
slave
s that have this label.
* situations such as (1) there are offline
agent
s that have this label (2) clouds exist
* that can provision
agent
s that have this label.
*/
public
boolean
isAssignable
()
{
for
(
Node
n
:
getNodes
())
...
...
core/src/main/java/hudson/model/LoadStatistics.java
浏览文件 @
320e6c07
...
...
@@ -390,7 +390,7 @@ public abstract class LoadStatistics {
Jenkins
j
=
Jenkins
.
getInstance
();
List
<
Queue
.
BuildableItem
>
bis
=
j
.
getQueue
().
getBuildableItems
();
// update statistics on
slave
s
// update statistics on
agent
s
for
(
Label
l
:
j
.
getLabels
()
)
{
l
.
loadStatistics
.
updateCounts
(
l
.
loadStatistics
.
computeSnapshot
(
bis
));
}
...
...
@@ -421,7 +421,7 @@ public abstract class LoadStatistics {
private
static
final
long
serialVersionUID
=
1L
;
/**
* The total number of executors that Jenkins currently knows, this includes all off-line
slave
s.
* The total number of executors that Jenkins currently knows, this includes all off-line
agent
s.
*/
private
final
int
definedExecutors
;
/**
...
...
@@ -467,7 +467,7 @@ public abstract class LoadStatistics {
}
/**
* The total number of executors that Jenkins currently knows, this includes all off-line
slave
s.
* The total number of executors that Jenkins currently knows, this includes all off-line
agent
s.
*/
@Exported
public
int
getDefinedExecutors
()
{
...
...
core/src/main/java/hudson/model/Node.java
浏览文件 @
320e6c07
...
...
@@ -72,7 +72,7 @@ import org.kohsuke.stapler.export.Exported;
import
org.kohsuke.stapler.export.ExportedBean
;
/**
* Base type of Jenkins
slaves (although in practice, you probably extend {@link Slave} to define a new slave
type).
* Base type of Jenkins
agents (although in practice, you probably extend {@link Slave} to define a new agent
type).
*
* <p>
* As a special case, {@link Jenkins} extends from here.
...
...
@@ -83,7 +83,7 @@ import org.kohsuke.stapler.export.ExportedBean;
*
* <p>
* There is no URL binding for {@link Node}. {@link Computer} and {@link TransientComputerActionFactory} must
* be used to associate new {@link Action}s to
slave
s.
* be used to associate new {@link Action}s to
agent
s.
*
* @author Kohsuke Kawaguchi
* @see NodeDescriptor
...
...
@@ -95,7 +95,7 @@ public abstract class Node extends AbstractModelObject implements Reconfigurable
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
Node
.
class
.
getName
());
/**
* Newly copied
slave
s get this flag set, so that Jenkins doesn't try to start/remove this node until its configuration
* Newly copied
agent
s get this flag set, so that Jenkins doesn't try to start/remove this node until its configuration
* is saved once.
*/
protected
volatile
transient
boolean
holdOffLaunchUntilSave
;
...
...
@@ -216,7 +216,7 @@ public abstract class Node extends AbstractModelObject implements Reconfigurable
protected
abstract
Computer
createComputer
();
/**
* Returns {@code true} if the node is accepting tasks. Needed to allow
slave
s programmatic suspension of task
* Returns {@code true} if the node is accepting tasks. Needed to allow
agent
s programmatic suspension of task
* scheduling that does not overlap with being offline. Called by {@link Computer#isAcceptingTasks()}.
* This method is distinct from {@link Computer#isAcceptingTasks()} as sometimes the {@link Node} concrete
* class may not have control over the {@link hudson.model.Computer} concrete class associated with it.
...
...
@@ -281,7 +281,7 @@ public abstract class Node extends AbstractModelObject implements Reconfigurable
* {@link LabelFinder} extension point.
*
* This method has a side effect of updating the hudson-wide set of labels
* and should be called after events that will change that - e.g. a
slave
* and should be called after events that will change that - e.g. a
agent
* connecting.
*/
@Exported
...
...
@@ -499,7 +499,7 @@ public abstract class Node extends AbstractModelObject implements Reconfigurable
public
abstract
NodeDescriptor
getDescriptor
();
/**
* Estimates the clock difference with this
slave
.
* Estimates the clock difference with this
agent
.
*
* @return
* always non-null.
...
...
@@ -524,7 +524,7 @@ public abstract class Node extends AbstractModelObject implements Reconfigurable
public
abstract
Callable
<
ClockDifference
,
IOException
>
getClockDifferenceCallable
();
/**
* Constants that control how Hudson allocates jobs to
slave
s.
* Constants that control how Hudson allocates jobs to
agent
s.
*/
public
enum
Mode
{
NORMAL
(
Messages
.
_Node_Mode_NORMAL
()),
...
...
core/src/main/java/hudson/model/OverallLoadStatistics.java
浏览文件 @
320e6c07
...
...
@@ -32,7 +32,7 @@ import org.kohsuke.accmod.restrictions.NoExternalUse;
import
org.kohsuke.stapler.export.Exported
;
/**
* {@link LoadStatistics} for the entire system (the master and all the
slave
s combined),
* {@link LoadStatistics} for the entire system (the master and all the
agent
s combined),
* and all the jobs that are running on it.
*
* @author Kohsuke Kawaguchi
...
...
core/src/main/java/hudson/model/Queue.java
浏览文件 @
320e6c07
...
...
@@ -2518,7 +2518,7 @@ public class Queue extends ResourceController implements Saveable {
Label
label
=
getAssignedLabel
();
List
<
Node
>
allNodes
=
jenkins
.
getNodes
();
if
(
allNodes
.
isEmpty
())
label
=
null
;
// no master/
slave
. pointless to talk about nodes
label
=
null
;
// no master/
agent
. pointless to talk about nodes
if
(
label
!=
null
)
{
Set
<
Node
>
nodes
=
label
.
getNodes
();
...
...
core/src/main/java/hudson/model/Result.java
浏览文件 @
320e6c07
...
...
@@ -161,7 +161,7 @@ public final class Result implements Serializable, CustomExportedBean {
return
l
;
}
// Maintain each Result as a singleton deserialized (like build result from a
slave
node)
// Maintain each Result as a singleton deserialized (like build result from a
n agent
node)
private
Object
readResolve
()
{
for
(
Result
r
:
all
)
if
(
ordinal
==
r
.
ordinal
)
...
...
core/src/main/java/hudson/model/Run.java
浏览文件 @
320e6c07
...
...
@@ -624,7 +624,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
/**
* When the build has started running in an executor.
*
* For example, if a build is scheduled 1pm, and stayed in the queue for 1 hour (say, no idle
slave
s),
* For example, if a build is scheduled 1pm, and stayed in the queue for 1 hour (say, no idle
agent
s),
* then this method returns 2pm, which is the time the job moved from the queue to the building state.
*
* @see #getTimestamp()
...
...
core/src/main/java/hudson/model/Slave.java
浏览文件 @
320e6c07
...
...
@@ -73,7 +73,7 @@ import org.kohsuke.stapler.StaplerRequest;
import
org.kohsuke.stapler.StaplerResponse
;
/**
* Information about a Hudson
slave
node.
* Information about a Hudson
agent
node.
*
* <p>
* Ideally this would have been in the <tt>hudson.slaves</tt> package,
...
...
@@ -86,7 +86,7 @@ import org.kohsuke.stapler.StaplerResponse;
*/
public
abstract
class
Slave
extends
Node
implements
Serializable
{
/**
* Name of this
slave
node.
* Name of this
agent
node.
*/
protected
String
name
;
...
...
@@ -116,12 +116,12 @@ public abstract class Slave extends Node implements Serializable {
private
Mode
mode
;
/**
*
Slave
availablility strategy.
*
Agent
availablility strategy.
*/
private
RetentionStrategy
retentionStrategy
;
/**
* The starter that will startup this
slave
.
* The starter that will startup this
agent
.
*/
private
ComputerLauncher
launcher
;
...
...
@@ -139,7 +139,7 @@ public abstract class Slave extends Node implements Serializable {
private
transient
volatile
Set
<
Label
>
labels
;
/**
* Id of user which creates this
slave
{@link User}.
* Id of user which creates this
agent
{@link User}.
*/
private
String
userId
;
...
...
@@ -173,7 +173,7 @@ public abstract class Slave extends Node implements Serializable {
Slave
node
=
(
Slave
)
Jenkins
.
getInstance
().
getNode
(
name
);
if
(
node
!=
null
){
this
.
userId
=
node
.
getUserId
();
//
slave
has already existed
this
.
userId
=
node
.
getUserId
();
//
agent
has already existed
}
else
{
User
user
=
User
.
current
();
...
...
@@ -190,7 +190,7 @@ public abstract class Slave extends Node implements Serializable {
}
/**
* Return id of user which created this
slave
* Return id of user which created this
agent
*
* @return id of user
*/
...
...
@@ -300,7 +300,7 @@ public abstract class Slave extends Node implements Serializable {
}
/**
* Root directory on this
slave
where all the job workspaces are laid out.
* Root directory on this
agent
where all the job workspaces are laid out.
* @return
* null if not connected.
*/
...
...
@@ -372,7 +372,7 @@ public abstract class Slave extends Node implements Serializable {
}
/**
* Creates a launcher for the
slave
.
* Creates a launcher for the
agent
.
*
* @return
* If there is no computer it will return a {@link hudson.Launcher.DummyLauncher}, otherwise it
...
...
@@ -381,7 +381,7 @@ public abstract class Slave extends Node implements Serializable {
public
Launcher
createLauncher
(
TaskListener
listener
)
{
SlaveComputer
c
=
getComputer
();
if
(
c
==
null
)
{
listener
.
error
(
"Issue with creating launcher for
slave
"
+
name
+
"."
);
listener
.
error
(
"Issue with creating launcher for
agent
"
+
name
+
"."
);
return
new
Launcher
.
DummyLauncher
(
listener
);
}
else
{
return
new
RemoteLauncher
(
listener
,
c
.
getChannel
(),
c
.
isUnix
()).
decorateFor
(
this
);
...
...
@@ -438,7 +438,7 @@ public abstract class Slave extends Node implements Serializable {
}
/**
* Performs syntactical check on the remote FS for
slave
s.
* Performs syntactical check on the remote FS for
agent
s.
*/
public
FormValidation
doCheckRemoteFS
(
@QueryParameter
String
value
)
throws
IOException
,
ServletException
{
if
(
Util
.
fixEmptyAndTrim
(
value
)==
null
)
...
...
core/src/main/java/hudson/model/TaskListener.java
浏览文件 @
320e6c07
...
...
@@ -37,7 +37,7 @@ import java.io.Serializable;
/**
* Receives events that happen during some lengthy operation
* that has some chance of failures, such as a build, SCM change polling,
*
slave
launch, and so on.
*
agent
launch, and so on.
*
* <p>
* This interface is implemented by Hudson core and passed to extension points so that
...
...
core/src/main/java/hudson/model/WorkspaceBrowser.java
浏览文件 @
320e6c07
...
...
@@ -33,8 +33,8 @@ import javax.annotation.CheckForNull;
/**
* Allows to access a workspace as an alternative to online build node.
* <p>
* Primary use case is {@link hudson.slaves.Cloud} implementations that don't keep the
slave
*
node
online to browse workspace, but maintain a copy of node workspace on master.
* Primary use case is {@link hudson.slaves.Cloud} implementations that don't keep the
agent
* online to browse workspace, but maintain a copy of node workspace on master.
*
* @author <a href="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a>
* @since 1.502
...
...
core/src/main/java/hudson/model/WorkspaceCleanupThread.java
浏览文件 @
320e6c07
...
...
@@ -38,7 +38,7 @@ import jenkins.model.Jenkins;
import
jenkins.model.ModifiableTopLevelItemGroup
;
/**
* Clean up old left-over workspaces from
slave
s.
* Clean up old left-over workspaces from
agent
s.
*
* @author Kohsuke Kawaguchi
*/
...
...
core/src/main/java/hudson/node_monitors/AbstractAsyncNodeMonitorDescriptor.java
浏览文件 @
320e6c07
...
...
@@ -20,7 +20,7 @@ import static java.util.logging.Level.WARNING;
/**
* Sophisticated version of {@link AbstractNodeMonitorDescriptor} that
* performs monitoring on all
slave
s concurrently and asynchronously.
* performs monitoring on all
agent
s concurrently and asynchronously.
*
* @param <T>
* represents the the result of the monitoring.
...
...
core/src/main/java/hudson/node_monitors/ArchitectureMonitor.java
浏览文件 @
320e6c07
...
...
@@ -33,7 +33,7 @@ import org.kohsuke.stapler.StaplerRequest;
import
java.io.IOException
;
/**
* Discovers the architecture of the system to display in the
slave
list page.
* Discovers the architecture of the system to display in the
agent
list page.
*
* @author Kohsuke Kawaguchi
*/
...
...
core/src/main/java/hudson/node_monitors/NodeMonitor.java
浏览文件 @
320e6c07
...
...
@@ -114,11 +114,11 @@ public abstract class NodeMonitor implements ExtensionPoint, Describable<NodeMon
}
/**
* True if this monitoring shouldn't mark the
slave
s offline.
* True if this monitoring shouldn't mark the
agent
s offline.
*
* <p>
* Many {@link NodeMonitor}s implement a logic that if the value goes above/below
* a threshold, the
slave
will be marked offline as a preventive measure.
* a threshold, the
agent
will be marked offline as a preventive measure.
* This flag controls that.
*
* <p>
...
...
core/src/main/java/hudson/node_monitors/NodeMonitorUpdater.java
浏览文件 @
320e6c07
...
...
@@ -14,7 +14,7 @@ import java.util.concurrent.TimeUnit;
import
jenkins.util.Timer
;
/**
* When a
slave
is connected, redo the node monitoring.
* When a
n agent
is connected, redo the node monitoring.
*
* @author Kohsuke Kawaguchi
*/
...
...
@@ -34,7 +34,7 @@ public class NodeMonitorUpdater extends ComputerListener {
/**
* Triggers the update with 5 seconds quiet period, to avoid triggering data check too often
* when multiple
slave
s become online at about the same time.
* when multiple
agent
s become online at about the same time.
*/
@Override
public
void
onOnline
(
Computer
c
,
TaskListener
listener
)
throws
IOException
,
InterruptedException
{
...
...
core/src/main/java/hudson/node_monitors/ResponseTimeMonitor.java
浏览文件 @
320e6c07
...
...
@@ -40,7 +40,7 @@ import org.kohsuke.stapler.export.Exported;
import
org.kohsuke.stapler.export.ExportedBean
;
/**
* Monitors the round-trip response time to this
slave
.
* Monitors the round-trip response time to this
agent
.
*
* @author Kohsuke Kawaguchi
*/
...
...
@@ -64,9 +64,9 @@ public class ResponseTimeMonitor extends NodeMonitor {
}
if
(
d
.
hasTooManyTimeouts
()
&&
!
isIgnored
())
{
// unlike other monitors whose failure still allow us to communicate with the
slave
,
// unlike other monitors whose failure still allow us to communicate with the
agent
,
// the failure in this monitor indicates that we are just unable to make any requests
// to this
slave
. So we should severe the connection, as opposed to marking it temporarily
// to this
agent
. So we should severe the connection, as opposed to marking it temporarily
// off line, which still keeps the underlying channel open.
c
.
disconnect
(
d
);
LOGGER
.
warning
(
Messages
.
ResponseTimeMonitor_MarkedOffline
(
c
.
getName
()));
...
...
core/src/main/java/hudson/os/solaris/ZFSProvisioner.java
浏览文件 @
320e6c07
...
...
@@ -59,7 +59,7 @@ public class ZFSProvisioner extends FileSystemProvisioner implements Serializabl
ZFSFileSystem
fs
=
libzfs
.
getFileSystemByMountPoint
(
f
);
if
(
fs
!=
null
)
return
fs
.
getName
();
// TODO: for now, only support
slave
s that are already on ZFS.
// TODO: for now, only support
agent
s that are already on ZFS.
throw
new
IOException
(
"Not on ZFS"
);
}
});
...
...
core/src/main/java/hudson/scm/SCM.java
浏览文件 @
320e6c07
...
...
@@ -152,7 +152,7 @@ public abstract class SCM implements Describable<SCM>, ExtensionPoint {
*
* <p>
* This flag affects the behavior of Hudson when a job lost its workspace
* (typically due to a
slave
outage.) If this method returns false and
* (typically due to a
agent
outage.) If this method returns false and
* polling is configured, then that would immediately trigger a new build.
*
* <p>
...
...
@@ -177,9 +177,9 @@ public abstract class SCM implements Describable<SCM>, ExtensionPoint {
* Called before a workspace is deleted on the given node, to provide SCM an opportunity to perform clean up.
*
* <p>
* Hudson periodically scans through all the
slave
s and removes old workspaces that are deemed unnecessary.
* Hudson periodically scans through all the
agent
s and removes old workspaces that are deemed unnecessary.
* This behavior is implemented in {@link WorkspaceCleanupThread}, and it is necessary to control the
* disk consumption on
slaves. If we don't do this, in a long run, all the slave
s will have workspaces
* disk consumption on
agents. If we don't do this, in a long run, all the agent
s will have workspaces
* for all the projects, which will be prohibitive in big Hudson.
*
* <p>
...
...
@@ -191,7 +191,7 @@ public abstract class SCM implements Describable<SCM>, ExtensionPoint {
* recursive directory deletion happens.
*
* <p>
* Note that this method does not guarantee that such a clean up will happen. For example,
slave
s can be
* Note that this method does not guarantee that such a clean up will happen. For example,
agent
s can be
* taken offline by being physically removed from the network, and in such a case there's no opportunity
* to perform this clean up.
*
...
...
@@ -233,7 +233,7 @@ public abstract class SCM implements Describable<SCM>, ExtensionPoint {
* Checks if there has been any changes to this module in the repository.
*
* TODO: we need to figure out a better way to communicate an error back,
* so that we won't keep retrying the same node (for example a
slave
might be down.)
* so that we won't keep retrying the same node (for example a
n agent
might be down.)
*
* <p>
* If the SCM doesn't implement polling, have the {@link #supportsPolling()} method
...
...
core/src/main/java/hudson/slaves/AbstractCloudComputer.java
浏览文件 @
320e6c07
...
...
@@ -50,7 +50,7 @@ public class AbstractCloudComputer<T extends AbstractCloudSlave> extends SlaveCo
}
/**
* When the
slave
is deleted, free the node right away.
* When the
agent
is deleted, free the node right away.
*/
@Override
public
HttpResponse
doDoDelete
()
throws
IOException
{
...
...
core/src/main/java/hudson/slaves/AbstractCloudSlave.java
浏览文件 @
320e6c07
...
...
@@ -55,7 +55,7 @@ public abstract class AbstractCloudSlave extends Slave {
public
abstract
AbstractCloudComputer
createComputer
();
/**
* Releases and removes this
slave
.
* Releases and removes this
agent
.
*/
public
void
terminate
()
throws
InterruptedException
,
IOException
{
final
Computer
computer
=
toComputer
();
...
...
core/src/main/java/hudson/slaves/ChannelPinger.java
浏览文件 @
320e6c07
...
...
@@ -74,7 +74,7 @@ public class ChannelPinger extends ComputerListener {
public
void
install
(
Channel
channel
)
{
if
(
pingInterval
<
1
)
{
LOGGER
.
fine
(
"
Slave
ping is disabled"
);
LOGGER
.
fine
(
"
Agent
ping is disabled"
);
return
;
}
...
...
core/src/main/java/hudson/slaves/Cloud.java
浏览文件 @
320e6c07
...
...
@@ -44,23 +44,23 @@ import org.kohsuke.stapler.DataBoundConstructor;
import
java.util.Collection
;
/**
* Creates {@link Node}s to dynamically expand/shrink the
slave
s attached to Hudson.
* Creates {@link Node}s to dynamically expand/shrink the
agent
s attached to Hudson.
*
* <p>
* Put another way, this class encapsulates different communication protocols
* needed to start a new
slave
programmatically.
* needed to start a new
agent
programmatically.
*
* <h2>Notes for implementers</h2>
* <h4>Automatically delete idle
slave
s</h4>
* <h4>Automatically delete idle
agent
s</h4>
* <p>
* Nodes provisioned from a cloud do not automatically get released just because it's created from {@link Cloud}.
* Doing so requires a use of {@link RetentionStrategy}. Instantiate your {@link Slave} subtype with something
* like {@link CloudSlaveRetentionStrategy} so that it gets automatically deleted after some idle time.
*
* <h4>Freeing an external resource when a
slave
is removed</h4>
* <h4>Freeing an external resource when a
n agent
is removed</h4>
* <p>
* Whether you do auto scale-down or not, you often want to release an external resource tied to a cloud-allocated
*
slave
when it is removed.
*
agent
when it is removed.
*
* <p>
* To do this, have your {@link Slave} subtype remember the necessary handle (such as EC2 instance ID)
...
...
@@ -137,7 +137,7 @@ public abstract class Cloud extends AbstractModelObject implements ExtensionPoin
* @param excessWorkload
* Number of total executors needed to meet the current demand.
* Always >= 1. For example, if this is 3, the implementation
* should launch 3
slaves with 1 executor each, or 1 slave
with
* should launch 3
agents with 1 executor each, or 1 agent
with
* 3 executors, etc.
* @return
* {@link PlannedNode}s that represent asynchronous {@link Node}
...
...
core/src/main/java/hudson/slaves/CloudSlaveRetentionStrategy.java
浏览文件 @
320e6c07
...
...
@@ -11,9 +11,9 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
/**
* Default convenience implementation of {@link RetentionStrategy} for
slave
s provisioned from {@link Cloud}.
* Default convenience implementation of {@link RetentionStrategy} for
agent
s provisioned from {@link Cloud}.
*
* If a
slave is idle for 10 mins, this retention strategy will remove the slave
. This can be used as-is for
* If a
n agent is idle for 10 mins, this retention strategy will remove the agent
. This can be used as-is for
* a {@link Node} provisioned by cloud to implement the auto-scaling semantics, it can be subtyped to tweak
* the behavior, or it can be used as an example.
* <p>TODO {@link CloudRetentionStrategy} seems to be a better implementation.
...
...
@@ -64,7 +64,7 @@ public class CloudSlaveRetentionStrategy<T extends Computer> extends RetentionSt
}
/**
* If the computer has been idle longer than this time, we'll kill the
slave
.
* If the computer has been idle longer than this time, we'll kill the
agent
.
*/
protected
long
getIdleMaxTime
()
{
return
TIMEOUT
;
...
...
core/src/main/java/hudson/slaves/CommandLauncher.java
浏览文件 @
320e6c07
...
...
@@ -140,7 +140,7 @@ public class CommandLauncher extends ComputerLauncher {
}
});
LOGGER
.
info
(
"
slave
agent launched for "
+
computer
.
getDisplayName
());
LOGGER
.
info
(
"agent launched for "
+
computer
.
getDisplayName
());
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
(
listener
.
error
(
Messages
.
ComputerLauncher_abortedLaunch
()));
}
catch
(
RuntimeException
e
)
{
...
...
core/src/main/java/hudson/slaves/ComputerLauncher.java
浏览文件 @
320e6c07
...
...
@@ -37,7 +37,7 @@ import org.apache.tools.ant.util.DeweyDecimal;
/**
* Extension point to allow control over how {@link Computer}s are "launched",
* meaning how they get connected to their
slave
agent program.
* meaning how they get connected to their agent program.
*
* <h2>Associated View</h2>
* <dl>
...
...
@@ -54,17 +54,17 @@ import org.apache.tools.ant.util.DeweyDecimal;
public
abstract
class
ComputerLauncher
extends
AbstractDescribableImpl
<
ComputerLauncher
>
implements
ExtensionPoint
{
/**
* Returns true if this {@link ComputerLauncher} supports
* programatic launch of the
slave
agent in the target {@link Computer}.
* programatic launch of the agent in the target {@link Computer}.
*/
public
boolean
isLaunchSupported
()
{
return
true
;
}
/**
* Launches the
slave
agent for the given {@link Computer}.
* Launches the agent for the given {@link Computer}.
*
* <p>
* If the
slave
agent is launched successfully, {@link SlaveComputer#setChannel(InputStream, OutputStream, TaskListener, Channel.Listener)}
* If the agent is launched successfully, {@link SlaveComputer#setChannel(InputStream, OutputStream, TaskListener, Channel.Listener)}
* should be invoked in the end to notify Hudson of the established connection.
* The operation could also fail, in which case there's no need to make any callback notification,
* (except to notify the user of the failure through {@link StreamTaskListener}.)
...
...
core/src/main/java/hudson/slaves/ComputerListener.java
浏览文件 @
320e6c07
...
...
@@ -51,7 +51,7 @@ public abstract class ComputerListener implements ExtensionPoint {
*
* <p>
* This enables you to do some configurable checks to see if we
* want to bring this
slave
online or if there are considerations
* want to bring this
agent
online or if there are considerations
* that would keep us from doing so.
*
* <p>
...
...
@@ -61,7 +61,7 @@ public abstract class ComputerListener implements ExtensionPoint {
* @param c
* Computer that's being launched. Never null.
* @param taskListener
* Connected to the
slave
console log. Useful for reporting progress/errors on a lengthy operation.
* Connected to the
agent
console log. Useful for reporting progress/errors on a lengthy operation.
* Never null.
* @throws AbortException
* Exceptions will be recorded to the listener, and
...
...
@@ -73,12 +73,12 @@ public abstract class ComputerListener implements ExtensionPoint {
}
/**
* Called when a
slave
attempted to connect via {@link ComputerLauncher} but it failed.
* Called when a
n agent
attempted to connect via {@link ComputerLauncher} but it failed.
*
* @param c
* Computer that was trying to launch. Never null.
* @param taskListener
* Connected to the
slave
console log. Useful for reporting progress/errors on a lengthy operation.
* Connected to the
agent
console log. Useful for reporting progress/errors on a lengthy operation.
* Never null.
*
* @since 1.402
...
...
@@ -90,19 +90,19 @@ public abstract class ComputerListener implements ExtensionPoint {
* Called before a {@link Computer} is marked online.
*
* <p>
* This enables you to do some work on all the
slave
s
* This enables you to do some work on all the
agent
s
* as they get connected. Unlike {@link #onOnline(Computer, TaskListener)},
* a failure to carry out this function normally will prevent
* a computer from marked as online.
*
* @param channel
* This is the channel object to talk to the
slave
.
* This is the channel object to talk to the
agent
.
* (This is the same object returned by {@link Computer#getChannel()} once
* it's connected.
* @param root
* The directory where this
slave
stores files.
* The directory where this
agent
stores files.
* The same as {@link Node#getRootPath()}, except that method returns
* null until the
slave
is connected. So this parameter is passed explicitly instead.
* null until the
agent
is connected. So this parameter is passed explicitly instead.
* @param listener
* This is connected to the launch log of the computer.
* Since this method is called synchronously from the thread
...
...
@@ -136,11 +136,11 @@ public abstract class ComputerListener implements ExtensionPoint {
* Called right after a {@link Computer} comes online.
*
* <p>
* This enables you to do some work on all the
slave
s
* This enables you to do some work on all the
agent
s
* as they get connected.
*
* <p>
* Starting Hudson 1.312, this method is also invoked for the master, not just for
slave
s.
* Starting Hudson 1.312, this method is also invoked for the master, not just for
agent
s.
*
* @param listener
* This is connected to the launch log of the computer.
...
...
@@ -199,7 +199,7 @@ public abstract class ComputerListener implements ExtensionPoint {
* Called when configuration of the node was changed, a node is added/removed, etc.
*
* <p>
* This callback is to signal when there's any change to the list of
slave
s registered to the system,
* This callback is to signal when there's any change to the list of
agent
s registered to the system,
* including addition, removal, changing of the setting, and so on.
*
* @since 1.377
...
...
core/src/main/java/hudson/slaves/ComputerRetentionWork.java
浏览文件 @
320e6c07
...
...
@@ -34,7 +34,7 @@ import hudson.model.PeriodicWork;
import
hudson.Extension
;
/**
* Periodically checks the
slaves and try to reconnect dead slave
s.
* Periodically checks the
agents and try to reconnect dead agent
s.
*
* @author Kohsuke Kawaguchi
* @author Stephen Connolly
...
...
core/src/main/java/hudson/slaves/ConnectionActivityMonitor.java
浏览文件 @
320e6c07
...
...
@@ -37,7 +37,7 @@ import java.io.IOException;
import
java.util.logging.Logger
;
/**
* Makes sure that connections to
slave
s are alive, and if they are not, cut them off.
* Makes sure that connections to
agent
s are alive, and if they are not, cut them off.
*
* <p>
* If we only rely on TCP retransmission time out for this, the time it takes to detect a bad connection
...
...
@@ -49,7 +49,7 @@ import java.util.logging.Logger;
@Extension
public
class
ConnectionActivityMonitor
extends
AsyncPeriodicWork
{
public
ConnectionActivityMonitor
()
{
super
(
"Connection Activity monitoring to
slave
s"
);
super
(
"Connection Activity monitoring to
agent
s"
);
}
protected
void
execute
(
TaskListener
listener
)
throws
IOException
,
InterruptedException
{
...
...
@@ -61,7 +61,7 @@ public class ConnectionActivityMonitor extends AsyncPeriodicWork {
if
(
ch
instanceof
Channel
)
{
Channel
channel
=
(
Channel
)
ch
;
if
(
now
-
channel
.
getLastHeard
()
>
TIME_TILL_PING
)
{
// haven't heard from this
slave
for a while.
// haven't heard from this
agent
for a while.
Long
lastPing
=
(
Long
)
channel
.
getProperty
(
ConnectionActivityMonitor
.
class
);
if
(
lastPing
!=
null
&&
now
-
lastPing
>
TIMEOUT
)
{
...
...
core/src/main/java/hudson/slaves/EnvironmentVariablesNodeProperty.java
浏览文件 @
320e6c07
...
...
@@ -47,7 +47,7 @@ import java.util.List;
public
class
EnvironmentVariablesNodeProperty
extends
NodeProperty
<
Node
>
{
/**
*
Slave
-specific environment variables
*
Agent
-specific environment variables
*/
private
final
EnvVars
envVars
;
...
...
core/src/main/java/hudson/slaves/JNLPLauncher.java
浏览文件 @
320e6c07
...
...
@@ -37,7 +37,7 @@ import org.kohsuke.stapler.DataBoundConstructor;
*/
public
class
JNLPLauncher
extends
ComputerLauncher
{
/**
* If the
slave
needs to tunnel the connection to the master,
* If the
agent
needs to tunnel the connection to the master,
* specify the "host:port" here. This can include the special
* syntax "host:" and ":port" to indicate the default host/port
* shall be used.
...
...
core/src/main/java/hudson/slaves/NodeProperty.java
浏览文件 @
320e6c07
...
...
@@ -160,7 +160,7 @@ public abstract class NodeProperty<N extends Node> implements ReconfigurableDesc
* @param env
* Manipulate this variable (normally by adding more entries.)
* Note that this is an override, so it doesn't contain environment variables that are
* currently set for the
slave
process itself.
* currently set for the
agent
process itself.
* @param listener
* Can be used to send messages.
*
...
...
core/src/main/java/hudson/slaves/NodeProvisioner.java
浏览文件 @
320e6c07
...
...
@@ -228,13 +228,13 @@ public class NodeProvisioner {
}
catch
(
InterruptedException
e
)
{
throw
new
AssertionError
(
e
);
// since we confirmed that the future is already done
}
catch
(
ExecutionException
e
)
{
LOGGER
.
log
(
Level
.
WARNING
,
"Provisioned
slave
"
+
f
.
displayName
+
" failed to launch"
,
LOGGER
.
log
(
Level
.
WARNING
,
"Provisioned
agent
"
+
f
.
displayName
+
" failed to launch"
,
e
.
getCause
());
for
(
CloudProvisioningListener
cl
:
CloudProvisioningListener
.
all
())
{
cl
.
onFailure
(
f
,
e
.
getCause
());
}
}
catch
(
IOException
e
)
{
LOGGER
.
log
(
Level
.
WARNING
,
"Provisioned
slave
"
+
f
.
displayName
+
" failed to launch"
,
LOGGER
.
log
(
Level
.
WARNING
,
"Provisioned
agent
"
+
f
.
displayName
+
" failed to launch"
,
e
);
for
(
CloudProvisioningListener
cl
:
CloudProvisioningListener
.
all
())
{
cl
.
onFailure
(
f
,
e
);
...
...
@@ -244,7 +244,7 @@ public class NodeProvisioner {
throw
e
;
}
catch
(
Throwable
e
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
"Unexpected uncaught exception encountered while "
+
"processing provisioned
slave
"
+
f
.
displayName
,
e
);
+
"processing provisioned
agent
"
+
f
.
displayName
,
e
);
}
finally
{
while
(
true
)
{
List
<
PlannedNode
>
orig
=
pendingLaunches
.
get
();
...
...
@@ -607,23 +607,23 @@ public class NodeProvisioner {
@Override
public
StrategyDecision
apply
(
@Nonnull
StrategyState
state
)
{
/*
Here we determine how many additional
slave
s we need to keep up with the load (if at all),
Here we determine how many additional
agent
s we need to keep up with the load (if at all),
which involves a simple math.
Broadly speaking, first we check that all the executors are fully utilized before attempting
to start any new
slave
(this also helps to ignore the temporary gap between different numbers,
to start any new
agent
(this also helps to ignore the temporary gap between different numbers,
as changes in them are not necessarily synchronized --- for example, there's a time lag between
when a
slave
launches (thus bringing the planned capacity down) and the time when its executors
when a
n agent
launches (thus bringing the planned capacity down) and the time when its executors
pick up builds (thus bringing the queue length down.)
Once we confirm that, we compare the # of buildable items against the additional
slave
s
that are being brought online. If we have more jobs than our executors can handle, we'll launch a new
slave
.
Once we confirm that, we compare the # of buildable items against the additional
agent
s
that are being brought online. If we have more jobs than our executors can handle, we'll launch a new
agent
.
So this computation involves three stats:
1. # of idle executors
2. # of jobs that are starving for executors
3. # of additional
slave
s being provisioned (planned capacities.)
3. # of additional
agent
s being provisioned (planned capacities.)
To ignore a temporary surge/drop, we make conservative estimates on each one of them. That is,
we take the current snapshot value, and we take the current exponential moving average (EMA) value,
...
...
@@ -675,14 +675,14 @@ public class NodeProvisioner {
CLOUD:
for
(
Cloud
c
:
Jenkins
.
getInstance
().
clouds
)
{
if
(
excessWorkload
<
0
)
{
break
;
// enough
slave
s allocated
break
;
// enough
agent
s allocated
}
// Make sure this cloud actually can provision for this label.
if
(
c
.
canProvision
(
state
.
getLabel
()))
{
// provisioning a new node should be conservative --- for example if excessWorkload is 1.4,
// we don't want to allocate two nodes but just one.
// OTOH, because of the exponential decay, even when we need one
slave
,
// OTOH, because of the exponential decay, even when we need one
agent
,
// excess workload is always
// something like 0.95, in which case we want to allocate one node.
// so the threshold here is 1-MARGIN, and hence floor(excessWorkload+MARGIN) is needed to
...
...
@@ -774,7 +774,7 @@ public class NodeProvisioner {
@Extension
public
static
class
NodeProvisionerInvoker
extends
PeriodicWork
{
/**
* Give some initial warm up time so that statically connected
slave
s
* Give some initial warm up time so that statically connected
agent
s
* can be brought online before we start allocating more.
*/
public
static
int
INITIALDELAY
=
Integer
.
getInteger
(
NodeProvisioner
.
class
.
getName
()+
".initialDelay"
,
LoadStatistics
.
CLOCK
*
10
);
...
...
core/src/main/java/hudson/slaves/RetentionStrategy.java
浏览文件 @
320e6c07
...
...
@@ -48,7 +48,7 @@ import java.util.logging.Logger;
public
abstract
class
RetentionStrategy
<
T
extends
Computer
>
extends
AbstractDescribableImpl
<
RetentionStrategy
<?>>
implements
ExtensionPoint
{
/**
* This method will be called periodically to allow this strategy to decide what to do with it's owning
slave
.
* This method will be called periodically to allow this strategy to decide what to do with it's owning
agent
.
*
* @param c {@link Computer} for which this strategy is assigned. This computer may be online or offline.
* This object also exposes a bunch of properties that the callee can use to decide what action to take.
...
...
@@ -59,11 +59,11 @@ public abstract class RetentionStrategy<T extends Computer> extends AbstractDesc
public
abstract
long
check
(
T
c
);
/**
* This method is called to determine whether manual launching of the
slave
is allowed at this point in time.
* This method is called to determine whether manual launching of the
agent
is allowed at this point in time.
* @param c {@link Computer} for which this strategy is assigned. This computer may be online or offline.
* This object also exposes a bunch of properties that the callee can use to decide if manual launching is
* allowed at this time.
* @return {@code true} if manual launching of the
slave
is allowed at this point in time.
* @return {@code true} if manual launching of the
agent
is allowed at this point in time.
*/
public
boolean
isManualLaunchAllowed
(
T
c
)
{
return
true
;
...
...
@@ -85,7 +85,7 @@ public abstract class RetentionStrategy<T extends Computer> extends AbstractDesc
/**
* Called when a new {@link Computer} object is introduced (such as when Hudson started, or when
* a new
slave
is added.)
* a new
agent
is added.)
*
* <p>
* The default implementation of this method delegates to {@link #check(Computer)},
...
...
@@ -180,12 +180,12 @@ public abstract class RetentionStrategy<T extends Computer> extends AbstractDesc
private
static
final
Logger
logger
=
Logger
.
getLogger
(
Demand
.
class
.
getName
());
/**
* The delay (in minutes) for which the
slave
must be in demand before tring to launch it.
* The delay (in minutes) for which the
agent
must be in demand before tring to launch it.
*/
private
final
long
inDemandDelay
;
/**
* The delay (in minutes) for which the
slave
must be idle before taking it offline.
* The delay (in minutes) for which the
agent
must be idle before taking it offline.
*/
private
final
long
idleDelay
;
...
...
core/src/main/java/hudson/slaves/SimpleScheduledRetentionStrategy.java
浏览文件 @
320e6c07
...
...
@@ -45,7 +45,7 @@ import java.util.logging.Logger;
import
static
java
.
util
.
logging
.
Level
.
INFO
;
/**
* {@link RetentionStrategy} that controls the
slave
based on a schedule.
* {@link RetentionStrategy} that controls the
agent
based on a schedule.
*
* @author Stephen Connolly
* @since 1.275
...
...
core/src/main/java/hudson/slaves/SlaveComputer.java
浏览文件 @
320e6c07
...
...
@@ -99,7 +99,7 @@ public class SlaveComputer extends Computer {
private
Boolean
isUnix
;
/**
* Effective {@link ComputerLauncher} that hides the details of
* how we launch a
slave
agent on this computer.
* how we launch a
agent
agent on this computer.
*
* <p>
* This is normally the same as {@link Slave#getLauncher()} but
...
...
@@ -162,7 +162,7 @@ public class SlaveComputer extends Computer {
@Override
@OverrideMustInvoke
(
When
.
ANYTIME
)
public
boolean
isAcceptingTasks
()
{
// our boolean flag is an override on any additional programmatic reasons why this
slave
might not be
// our boolean flag is an override on any additional programmatic reasons why this
agent
might not be
// accepting tasks.
return
acceptingTasks
&&
super
.
isAcceptingTasks
();
}
...
...
@@ -175,13 +175,13 @@ public class SlaveComputer extends Computer {
}
/**
* Allows suspension of tasks being accepted by the
slave
computer. While this could be called by a
* Allows suspension of tasks being accepted by the
agent
computer. While this could be called by a
* {@linkplain hudson.slaves.ComputerLauncher} or a {@linkplain hudson.slaves.RetentionStrategy}, such usage
* can result in fights between multiple actors calling setting differential values. A better approach
* is to override {@link hudson.slaves.RetentionStrategy#isAcceptingTasks(hudson.model.Computer)} if the
* {@link hudson.slaves.RetentionStrategy} needs to control availability.
*
* @param acceptingTasks {@code true} if the
slave
can accept tasks.
* @param acceptingTasks {@code true} if the
agent
can accept tasks.
*/
public
void
setAcceptingTasks
(
boolean
acceptingTasks
)
{
this
.
acceptingTasks
=
acceptingTasks
;
...
...
@@ -274,7 +274,7 @@ public class SlaveComputer extends Computer {
}
if
(
channel
==
null
)
throw
new
IOException
(
"
Slave
failed to connect, even though the launcher didn't report it. See the log output for details."
);
throw
new
IOException
(
"
Agent
failed to connect, even though the launcher didn't report it. See the log output for details."
);
return
null
;
}
});
...
...
@@ -350,7 +350,7 @@ public class SlaveComputer extends Computer {
}
/**
* Creates a {@link Channel} from the given stream and sets that to this
slave
.
* Creates a {@link Channel} from the given stream and sets that to this
agent
.
*
* @param in
* Stream connected to the remote "slave.jar". It's the caller's responsibility to do
...
...
@@ -426,11 +426,11 @@ public class SlaveComputer extends Computer {
}
/**
* Returns the remote FS root absolute path or {@code null} if the
slave
is off-line. The absolute path may change
* Returns the remote FS root absolute path or {@code null} if the
agent
is off-line. The absolute path may change
* between connections if the connection method does not provide a consistent working directory and the node's
* remote FS is specified as a relative path.
*
* @return the remote FS root absolute path or {@code null} if the
slave
is off-line.
* @return the remote FS root absolute path or {@code null} if the
agent
is off-line.
* @since 1.606
*/
@CheckForNull
...
...
@@ -575,7 +575,7 @@ public class SlaveComputer extends Computer {
}
finally
{
SecurityContextHolder
.
setContext
(
old
);
}
log
.
println
(
"
Slave
successfully connected and online"
);
log
.
println
(
"
Agent
successfully connected and online"
);
Jenkins
.
getInstance
().
getQueue
().
scheduleMaintenance
();
}
...
...
@@ -644,11 +644,11 @@ public class SlaveComputer extends Computer {
}
/**
* Serves jar files for JNLP
slave
agents.
* Serves jar files for JNLP agents.
*
* @deprecated since 2008-08-18.
* This URL binding is no longer used and moved up directly under to {@link jenkins.model.Jenkins},
* but it's left here for now just in case some old JNLP
slave
agents request it.
* but it's left here for now just in case some old JNLP agents request it.
*/
@Deprecated
public
Slave
.
JnlpJar
getJnlpJars
(
String
fileName
)
{
...
...
@@ -669,7 +669,7 @@ public class SlaveComputer extends Computer {
try
{
Util
.
deleteRecursive
(
getLogDir
());
}
catch
(
IOException
ex
)
{
logger
.
log
(
Level
.
WARNING
,
"Unable to delete
slave
logs"
,
ex
);
logger
.
log
(
Level
.
WARNING
,
"Unable to delete
agent
logs"
,
ex
);
}
}
...
...
@@ -706,7 +706,7 @@ public class SlaveComputer extends Computer {
super
.
setNode
(
node
);
launcher
=
grabLauncher
(
node
);
// maybe the configuration was changed to relaunch the
slave
, so try to re-launch now.
// maybe the configuration was changed to relaunch the
agent
, so try to re-launch now.
// "constructed==null" test is an ugly hack to avoid launching before the object is fully
// constructed.
if
(
constructed
!=
null
)
{
...
...
@@ -740,7 +740,7 @@ public class SlaveComputer extends Computer {
}
/**
* Get the
slave
version
* Get the
agent
version
*/
public
String
getSlaveVersion
()
throws
IOException
,
InterruptedException
{
return
channel
.
call
(
new
SlaveVersion
());
...
...
@@ -794,7 +794,7 @@ public class SlaveComputer extends Computer {
*/
static
final
class
LogHolder
{
/**
* This field is used on each
slave node to record log records on the slave
.
* This field is used on each
agent to record logs on the agent
.
*/
static
final
RingBufferLogHandler
SLAVE_LOG_HANDLER
=
new
RingBufferLogHandler
();
}
...
...
@@ -827,9 +827,9 @@ public class SlaveComputer extends Computer {
/**
* Obtains a {@link VirtualChannel} that allows some computation to be performed on the master.
* This method can be called from any thread on the master, or from
slave
(more precisely,
* it only works from the remoting request-handling thread in
slave
s, which means if you've started
* separate thread on
slave
s, that'll fail.)
* This method can be called from any thread on the master, or from
agent
(more precisely,
* it only works from the remoting request-handling thread in
agent
s, which means if you've started
* separate thread on
agent
s, that'll fail.)
*
* @return null if the calling thread doesn't have any trace of where its master is.
* @since 1.362
...
...
@@ -838,7 +838,7 @@ public class SlaveComputer extends Computer {
if
(
Jenkins
.
getInstance
()!=
null
)
return
FilePath
.
localChannel
;
// if this method is called from within the
slave
computation thread, this should work
// if this method is called from within the
agent
computation thread, this should work
Channel
c
=
Channel
.
current
();
if
(
c
!=
null
&&
Boolean
.
TRUE
.
equals
(
c
.
getProperty
(
"slave"
)))
return
c
;
...
...
core/src/main/java/hudson/tools/ToolInstallation.java
浏览文件 @
320e6c07
...
...
@@ -53,8 +53,8 @@ import jenkins.model.Jenkins;
* this class, but choosing this class as a base class has several benefits:
*
* <ul>
* <li>Hudson allows admins to specify different locations for tools on some
slave
s.
* For example, JDK on the master might be on /usr/local/java but on a Windows
slave
* <li>Hudson allows admins to specify different locations for tools on some
agent
s.
* For example, JDK on the master might be on /usr/local/java but on a Windows
agent
* it could be at c:\Program Files\Java
* <li>Hudson can verify the existence of tools and provide warnings and diagnostics for
* admins. (TBD)
...
...
core/src/main/java/hudson/tools/ToolInstaller.java
浏览文件 @
320e6c07
...
...
@@ -97,7 +97,7 @@ public abstract class ToolInstaller implements Describable<ToolInstaller>, Exten
* @return the (directory) path at which the tool can be found,
* typically coming from {@link #preferredLocation}
* @throws IOException if installation fails
* @throws InterruptedException if communication with a
slave
is interrupted
* @throws InterruptedException if communication with a
agent
is interrupted
*/
public
abstract
FilePath
performInstallation
(
ToolInstallation
tool
,
Node
node
,
TaskListener
log
)
throws
IOException
,
InterruptedException
;
...
...
core/src/main/java/hudson/util/ClockDifference.java
浏览文件 @
320e6c07
...
...
@@ -41,8 +41,8 @@ public final class ClockDifference {
/**
* The difference in milliseconds.
*
* Positive value means the
slave
is behind the master,
* negative value means the
slave
is ahead of the master.
* Positive value means the
agent
is behind the master,
* negative value means the
agent
is ahead of the master.
*/
@Exported
public
final
long
diff
;
...
...
core/src/main/java/hudson/util/ProcessKiller.java
浏览文件 @
320e6c07
...
...
@@ -38,7 +38,7 @@ import java.io.Serializable;
* <p>
* Each implementation of {@link ProcessKiller} is instantiated once on the master.
* Whenever a process needs to be killed, those implementations are serialized and sent over
* to the appropriate
slave
, then the {@link #kill(ProcessTree.OSProcess)} method is invoked
* to the appropriate
agent
, then the {@link #kill(ProcessTree.OSProcess)} method is invoked
* to attempt to kill the process.
*
* <p>
...
...
core/src/main/java/hudson/util/RemotingDiagnostics.java
浏览文件 @
320e6c07
...
...
@@ -61,7 +61,7 @@ import java.util.TreeMap;
* Various remoting operations related to diagnostics.
*
* <p>
* These code are useful wherever {@link VirtualChannel} is used, such as master,
slave
s, Maven JVMs, etc.
* These code are useful wherever {@link VirtualChannel} is used, such as master,
agent
s, Maven JVMs, etc.
*
* @author Kohsuke Kawaguchi
* @since 1.175
...
...
core/src/main/java/jenkins/SlaveToMasterFileCallable.java
浏览文件 @
320e6c07
...
...
@@ -5,7 +5,7 @@ import jenkins.security.Roles;
import
org.jenkinsci.remoting.RoleChecker
;
/**
* {@link FileCallable}s that can be executed on the master, sent by the
slave
.
* {@link FileCallable}s that can be executed on the master, sent by the
agent
.
*
* @since 1.THU
*/
...
...
core/src/main/java/jenkins/SoloFilePathFilter.java
浏览文件 @
320e6c07
...
...
@@ -28,7 +28,7 @@ public final class SoloFilePathFilter extends FilePathFilter {
private
boolean
noFalse
(
String
op
,
File
f
,
boolean
b
)
{
if
(!
b
)
throw
new
SecurityException
(
"
slave
may not "
+
op
+
" "
+
f
+
"\nSee http://jenkins-ci.org/security-144 for more details"
);
throw
new
SecurityException
(
"
agent
may not "
+
op
+
" "
+
f
+
"\nSee http://jenkins-ci.org/security-144 for more details"
);
return
true
;
}
...
...
core/src/main/java/jenkins/model/ArtifactManagerFactory.java
浏览文件 @
320e6c07
...
...
@@ -45,7 +45,7 @@ public abstract class ArtifactManagerFactory extends AbstractDescribableImpl<Art
* All configured factories are consulted in sequence; the first manager thus yielded (if any) will be stored in the build.
* {@link StandardArtifactManager} is used as a fallback.
* @param build a running (or recently completed) build ready for {@link ArtifactManager#archive}
* @return a manager, or null if this manager should not handle this kind of project, builds on this kind of
slave
, etc.
* @return a manager, or null if this manager should not handle this kind of project, builds on this kind of
agent
, etc.
*/
public
abstract
@CheckForNull
ArtifactManager
managerFor
(
Run
<?,?>
build
);
...
...
core/src/main/java/jenkins/model/Jenkins.java
浏览文件 @
320e6c07
...
...
@@ -563,7 +563,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
private
transient
final
CopyOnWriteList
<
SCMListener
>
scmListeners
=
new
CopyOnWriteList
<
SCMListener
>();
/**
* TCP
slave
agent port.
* TCP agent port.
* 0 for random, -1 to disable.
*/
private
int
slaveAgentPort
=
Integer
.
getInteger
(
Jenkins
.
class
.
getName
()+
".slaveAgentPort"
,
0
);
...
...
@@ -593,7 +593,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
public
transient
final
OverallLoadStatistics
overallLoad
=
new
OverallLoadStatistics
();
/**
* Load statistics of the free roaming jobs and
slave
s.
* Load statistics of the free roaming jobs and
agent
s.
*
* This includes all executors on {@link hudson.model.Node.Mode#NORMAL} nodes and jobs that do not have any assigned nodes.
*
...
...
@@ -613,7 +613,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
* Use {@link #unlabeledNodeProvisioner}.
* This was broken because it was tracking all the executors in the system, but it was only tracking
* free-roaming jobs in the queue. So {@link Cloud} fails to launch nodes when you have some exclusive
*
slave
s and free-roaming jobs in the queue.
*
agent
s and free-roaming jobs in the queue.
*/
@Restricted
(
NoExternalUse
.
class
)
@Deprecated
...
...
@@ -763,7 +763,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
theInstance
=
this
;
if
(!
new
File
(
root
,
"jobs"
).
exists
())
{
// if this is a fresh install, use more modern default layout that's consistent with
slave
s
// if this is a fresh install, use more modern default layout that's consistent with
agent
s
workspaceDir
=
"${JENKINS_HOME}/workspace/${ITEM_FULLNAME}"
;
}
...
...
@@ -988,8 +988,8 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
}
}
catch
(
BindException
e
)
{
new
AdministrativeError
(
administrativeMonitorId
,
"Failed to listen to incoming
slave
connection"
,
"Failed to listen to incoming
slave
connection. <a href='configure'>Change the port number</a> to solve the problem."
,
e
);
"Failed to listen to incoming
agent
connection"
,
"Failed to listen to incoming
agent
connection. <a href='configure'>Change the port number</a> to solve the problem."
,
e
);
}
}
}
...
...
@@ -1709,7 +1709,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
/**
* Gets the
slave
node of the give name, hooked under this Jenkins.
* Gets the
agent
node of the give name, hooked under this Jenkins.
*/
public
@CheckForNull
Node
getNode
(
String
name
)
{
return
nodes
.
getNode
(
name
);
...
...
@@ -2743,7 +2743,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
{
// recompute label objects - populates the labels mapping.
for
(
Node
slave
:
nodes
.
getNodes
())
// Note that not all labels are visible until the
slave
s have connected.
// Note that not all labels are visible until the
agent
s have connected.
slave
.
getAssignedLabels
();
getAssignedLabels
();
}
...
...
@@ -3054,10 +3054,10 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
}
/**
* Obtains the thread dump of all
slave
s (including the master.)
* Obtains the thread dump of all
agent
s (including the master.)
*
* <p>
* Since this is for diagnostics, it has a built-in precautionary measure against hang
slave
s.
* Since this is for diagnostics, it has a built-in precautionary measure against hang
agent
s.
*/
public
Map
<
String
,
Map
<
String
,
String
>>
getAllThreadDumps
()
throws
IOException
,
InterruptedException
{
checkPermission
(
ADMINISTER
);
...
...
@@ -3238,7 +3238,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
}
/**
* Serves jar files for JNLP
slave
agents.
* Serves jar files for JNLP agents.
*/
public
Slave
.
JnlpJar
getJnlpJars
(
String
fileName
)
{
return
new
Slave
.
JnlpJar
(
fileName
);
...
...
@@ -4263,7 +4263,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
private
static
final
String
WORKSPACE_DIRNAME
=
Configuration
.
getStringConfigParameter
(
"workspaceDirName"
,
"workspace"
);
/**
* Automatically try to launch a
slave
when Jenkins is initialized or a new slave is created.
* Automatically try to launch a
n agent
when Jenkins is initialized or a new slave is created.
*/
public
static
boolean
AUTOMATIC_SLAVE_LAUNCH
=
true
;
...
...
@@ -4322,7 +4322,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
assert
PERMISSIONS
!=
null
;
assert
ADMINISTER
!=
null
;
}
catch
(
RuntimeException
e
)
{
// when loaded on a
slave
and this fails, subsequent NoClassDefFoundError will fail to chain the cause.
// when loaded on a
n agent
and this fails, subsequent NoClassDefFoundError will fail to chain the cause.
// see http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8051847
// As we don't know where the first exception will go, let's also send this to logging so that
// we have a known place to look at.
...
...
core/src/main/java/jenkins/security/ChannelConfigurator.java
浏览文件 @
320e6c07
...
...
@@ -30,7 +30,7 @@ public abstract class ChannelConfigurator implements ExtensionPoint {
*
* <dl>
* <dt>{@link SlaveComputer}
* <dd>When a channel is being established to talk to a
slave
.
* <dd>When a channel is being established to talk to a
agent
.
* </dl>
*/
public
void
onChannelBuilding
(
ChannelBuilder
builder
,
@Nullable
Object
context
)
{}
...
...
core/src/main/java/jenkins/security/MasterToSlaveCallable.java
浏览文件 @
320e6c07
...
...
@@ -5,7 +5,7 @@ import org.jenkinsci.remoting.RoleChecker;
/**
* Convenient {@link Callable} meant to be run on
slave
.
* Convenient {@link Callable} meant to be run on
agent
.
*
* @author Kohsuke Kawaguchi
* @since 1.THU
...
...
core/src/main/java/jenkins/security/Roles.java
浏览文件 @
320e6c07
...
...
@@ -7,7 +7,7 @@ import org.jenkinsci.remoting.Role;
*
* <p>
* In Jenkins, there is really only one interesting role, which is the Jenkins master.
*
Slave
s, CLI, and Maven processes are all going to load classes from the master,
*
Agent
s, CLI, and Maven processes are all going to load classes from the master,
* which means it accepts anything that the master asks for, and thus they need
* not have any role.
*
...
...
@@ -16,14 +16,14 @@ import org.jenkinsci.remoting.Role;
*/
public
class
Roles
{
/**
* Indicates that a callable runs on masters, requested by
slave
s/CLI/maven/whatever.
* Indicates that a callable runs on masters, requested by
agent
s/CLI/maven/whatever.
*/
public
static
final
Role
MASTER
=
new
Role
(
"master"
);
/**
* Indicates that a callable is meant to run on
slave
s.
* Indicates that a callable is meant to run on
agent
s.
*
* This isn't used to reject callables to run on the
slave
, but rather to allow
* This isn't used to reject callables to run on the
agent
, but rather to allow
* the master to promptly reject callables that are really not meant to be run on
* the master (as opposed to ones that do not have that information, which gets
* {@link Role#UNKNOWN})
...
...
core/src/main/java/jenkins/security/SlaveToMasterCallable.java
浏览文件 @
320e6c07
...
...
@@ -5,7 +5,7 @@ import org.jenkinsci.remoting.RoleChecker;
/**
* Convenient {@link Callable} that are meant to run on the master (sent by
slave
/CLI/etc).
* Convenient {@link Callable} that are meant to run on the master (sent by
agent
/CLI/etc).
*
* @author Kohsuke Kawaguchi
* @since 1.THU
...
...
core/src/main/java/jenkins/security/s2m/AdminCallableMonitor.java
浏览文件 @
320e6c07
...
...
@@ -38,7 +38,7 @@ public class AdminCallableMonitor extends AdministrativeMonitor {
@Override
public
String
getDisplayName
()
{
return
"
Slave
\u2192 Master Access Control"
;
return
"
Agent
\u2192 Master Access Control"
;
}
// bind this to URL
...
...
core/src/main/java/jenkins/security/s2m/CallableDirectionChecker.java
浏览文件 @
320e6c07
...
...
@@ -55,11 +55,11 @@ public class CallableDirectionChecker extends RoleChecker {
if
(
isWhitelisted
(
subject
,
expected
))
{
// this subject is dubious, but we are letting it through as per whitelisting
LOGGER
.
log
(
Level
.
FINE
,
"Explicitly allowing {0} to be sent from
slave
to master"
,
name
);
LOGGER
.
log
(
Level
.
FINE
,
"Explicitly allowing {0} to be sent from
agent
to master"
,
name
);
return
;
}
throw
new
SecurityException
(
"Sending "
+
name
+
" from
slave
to master is prohibited.\nSee http://jenkins-ci.org/security-144 for more details"
);
throw
new
SecurityException
(
"Sending "
+
name
+
" from
agent
to master is prohibited.\nSee http://jenkins-ci.org/security-144 for more details"
);
}
/**
...
...
core/src/main/java/jenkins/security/s2m/DefaultFilePathFilter.java
浏览文件 @
320e6c07
...
...
@@ -36,7 +36,7 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
/**
* Blocks
slave
s from writing to files on the master by default (and also provide the kill switch.)
* Blocks
agent
s from writing to files on the master by default (and also provide the kill switch.)
*/
@Restricted
(
DoNotUse
.
class
)
// impl
@Extension
public
class
DefaultFilePathFilter
extends
ChannelConfigurator
{
...
...
@@ -53,7 +53,7 @@ import java.util.logging.Logger;
new
ReflectiveFilePathFilter
()
{
protected
boolean
op
(
String
op
,
File
f
)
throws
SecurityException
{
if
(
BYPASS
)
{
LOGGER
.
log
(
Level
.
FINE
,
"
slave
allowed to {0} {1}"
,
new
Object
[]
{
op
,
f
});
LOGGER
.
log
(
Level
.
FINE
,
"
agent
allowed to {0} {1}"
,
new
Object
[]
{
op
,
f
});
return
true
;
}
else
{
return
false
;
...
...
core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java
浏览文件 @
320e6c07
...
...
@@ -18,7 +18,7 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
/**
* Match the name against the
slave
name and route the incoming JNLP agent as {@link Slave}.
* Match the name against the
agent
name and route the incoming JNLP agent as {@link Slave}.
*
* @author Kohsuke Kawaguchi
* @since 1.561
...
...
@@ -55,7 +55,7 @@ public class DefaultJnlpSlaveReceiver extends JnlpAgentReceiver {
}
if
(!
matchesSecret
(
nodeName
,
handshake
))
{
handshake
.
error
(
nodeName
+
" can't be connected since the
slave
's secret does not match the handshake secret."
);
handshake
.
error
(
nodeName
+
" can't be connected since the
agent
's secret does not match the handshake secret."
);
return
true
;
}
...
...
@@ -75,7 +75,7 @@ public class DefaultJnlpSlaveReceiver extends JnlpAgentReceiver {
}
/**
* Called after the client has connected to check if the
slave
secret matches the handshake secret
* Called after the client has connected to check if the
agent
secret matches the handshake secret
*
* @param nodeName
* Name of the incoming JNLP agent. All {@link JnlpAgentReceiver} shares a single namespace
...
...
@@ -85,12 +85,12 @@ public class DefaultJnlpSlaveReceiver extends JnlpAgentReceiver {
* Encapsulation of the interaction with the incoming JNLP agent.
*
* @return
* true if the
slave
secret matches the handshake secret, false otherwise.
* true if the
agent
secret matches the handshake secret, false otherwise.
*/
private
boolean
matchesSecret
(
String
nodeName
,
JnlpSlaveHandshake
handshake
){
SlaveComputer
computer
=
(
SlaveComputer
)
Jenkins
.
getInstance
().
getComputer
(
nodeName
);
String
handshakeSecret
=
handshake
.
getRequestProperty
(
"Secret-Key"
);
// Verify that the
slave
secret matches the handshake secret.
// Verify that the
agent
secret matches the handshake secret.
if
(!
computer
.
getJnlpMac
().
equals
(
handshakeSecret
))
{
LOGGER
.
log
(
Level
.
WARNING
,
"An attempt was made to connect as {0} from {1} with an incorrect secret"
,
new
Object
[]{
nodeName
,
handshake
.
getSocket
()!=
null
?
handshake
.
getSocket
().
getRemoteSocketAddress
():
null
});
return
false
;
...
...
core/src/main/java/jenkins/slaves/EncryptedSlaveAgentJnlpFile.java
浏览文件 @
320e6c07
...
...
@@ -44,7 +44,7 @@ public class EncryptedSlaveAgentJnlpFile implements HttpResponse {
*/
private
final
String
viewName
;
/**
* Name of the
slave
, which is used to determine secret HMAC code.
* Name of the
agent
, which is used to determine secret HMAC code.
*/
private
final
String
slaveName
;
/**
...
...
core/src/main/java/jenkins/slaves/JnlpAgentReceiver.java
浏览文件 @
320e6c07
...
...
@@ -8,7 +8,7 @@ import java.io.IOException;
import
java.util.Properties
;
/**
* Receives incoming
slave
s connecting through {@link JnlpSlaveAgentProtocol2}.
* Receives incoming
agent
s connecting through {@link JnlpSlaveAgentProtocol2}.
*
* <p>
* This is useful to establish the communication with other JVMs and use them
...
...
core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol.java
浏览文件 @
320e6c07
...
...
@@ -25,26 +25,26 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
/**
* {@link AgentProtocol} that accepts connection from
slave
agents.
* {@link AgentProtocol} that accepts connection from agents.
*
* <h2>Security</h2>
* <p>
* Once connected, remote
slave
agents can send in commands to be
* Once connected, remote agents can send in commands to be
* executed on the master, so in a way this is like an rsh service.
* Therefore, it is important that we reject connections from
* unauthorized remote
slave
s.
* unauthorized remote
agent
s.
*
* <p>
* We do this by computing HMAC of the
slave
name.
* This code is sent to the
slave
inside the <tt>.jnlp</tt> file
* We do this by computing HMAC of the
agent
name.
* This code is sent to the
agent
inside the <tt>.jnlp</tt> file
* (this file itself is protected by HTTP form-based authentication that
* we use everywhere else in Jenkins), and the
slave
sends this
* we use everywhere else in Jenkins), and the
agent
sends this
* token back when it connects to the master.
* Unauthorized
slave
s can't access the protected <tt>.jnlp</tt> file,
* so it can't impersonate a valid
slave
.
* Unauthorized
agent
s can't access the protected <tt>.jnlp</tt> file,
* so it can't impersonate a valid
agent
.
*
* <p>
* We don't want to force the JNLP
slave
agents to be restarted
* We don't want to force the JNLP agents to be restarted
* whenever the server restarts, so right now this secret master key
* is generated once and used forever, which makes this whole scheme
* less secure.
...
...
@@ -96,7 +96,7 @@ public class JnlpSlaveAgentProtocol extends AgentProtocol {
SlaveComputer
computer
=
(
SlaveComputer
)
Jenkins
.
getInstance
().
getComputer
(
nodeName
);
if
(
computer
==
null
)
{
error
(
"No such
slave
: "
+
nodeName
);
error
(
"No such
agent
: "
+
nodeName
);
return
;
}
...
...
@@ -139,10 +139,10 @@ public class JnlpSlaveAgentProtocol extends AgentProtocol {
return
computer
.
getChannel
();
}
catch
(
AbortException
e
)
{
logw
.
println
(
e
.
getMessage
());
logw
.
println
(
"Failed to establish the connection with the
slave
"
);
logw
.
println
(
"Failed to establish the connection with the
agent
"
);
throw
e
;
}
catch
(
IOException
e
)
{
logw
.
println
(
"Failed to establish the connection with the
slave
"
+
nodeName
);
logw
.
println
(
"Failed to establish the connection with the
agent
"
+
nodeName
);
e
.
printStackTrace
(
logw
);
throw
e
;
}
...
...
@@ -152,7 +152,7 @@ public class JnlpSlaveAgentProtocol extends AgentProtocol {
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
JnlpSlaveAgentProtocol
.
class
.
getName
());
/**
* This secret value is used as a seed for
slave
s.
* This secret value is used as a seed for
agent
s.
*/
public
static
final
HMACConfidentialKey
SLAVE_SECRET
=
new
HMACConfidentialKey
(
JnlpSlaveAgentProtocol
.
class
,
"secret"
);
}
core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol2.java
浏览文件 @
320e6c07
...
...
@@ -12,7 +12,7 @@ import java.net.Socket;
*
* <p>
* This protocol extends the version 1 protocol by adding a per-client cookie,
* so that we can detect a reconnection from the
slave
and take appropriate action,
* so that we can detect a reconnection from the
agent
and take appropriate action,
* when the connection disappeared without the master noticing.
*
* @author Kohsuke Kawaguchi
...
...
@@ -45,7 +45,7 @@ public class JnlpSlaveAgentProtocol2 extends JnlpSlaveAgentProtocol {
}
/**
* Handles JNLP
slave
agent connection request (v2 protocol)
* Handles JNLP agent connection request (v2 protocol)
*/
@Override
protected
void
run
()
throws
IOException
,
InterruptedException
{
...
...
core/src/main/java/jenkins/slaves/JnlpSlaveHandshake.java
浏览文件 @
320e6c07
...
...
@@ -17,7 +17,7 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
/**
* Palette of objects to talk to the incoming JNLP
slave
connection.
* Palette of objects to talk to the incoming JNLP
agent
connection.
*
* @author Kohsuke Kawaguchi
* @since 1.561
...
...
@@ -29,7 +29,7 @@ public class JnlpSlaveHandshake {
/*package*/
final
NioChannelHub
hub
;
/**
* Socket connection to the
slave
.
* Socket connection to the
agent
.
*/
/*package*/
final
Socket
socket
;
...
...
core/src/main/java/jenkins/slaves/WorkspaceLocator.java
浏览文件 @
320e6c07
...
...
@@ -8,7 +8,7 @@ import hudson.model.TopLevelItem;
/**
* Allow extensions to override workspace locations
* on given
slave
s or projects.
* on given
agent
s or projects.
*
* @author ryan.campbell@gmail.com
* @since 1.501
...
...
@@ -17,11 +17,11 @@ public abstract class WorkspaceLocator implements ExtensionPoint {
/**
* Allows extensions to customize the workspace path. The first non-null response
* will determine the path to the workspace on that
slave
.
* will determine the path to the workspace on that
agent
.
*
* @param item The toplevel item
* @param node The
slave
node
* @return The absolute FilePath to the workspace on the
slave
.
* @param node The
agent
node
* @return The absolute FilePath to the workspace on the
agent
.
* Will be created if it doesn't exist.
*
*/
...
...
core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java
浏览文件 @
320e6c07
...
...
@@ -21,11 +21,11 @@ import static java.util.logging.Level.*;
import
jenkins.security.MasterToSlaveCallable
;
/**
* Actual
slave
restart logic.
* Actual
agent
restart logic.
*
* <p>
* Use {@link ComputerListener} to install {@link EngineListener}, which in turn gets executed when
* the
slave
gets disconnected.
* the
agent
gets disconnected.
*
* @author Kohsuke Kawaguchi
*/
...
...
@@ -73,15 +73,15 @@ public class JnlpSlaveRestarterInstaller extends ComputerListener implements Ser
try
{
for
(
SlaveRestarter
r
:
restarters
)
{
try
{
LOGGER
.
info
(
"Restarting
slave
via "
+
r
);
LOGGER
.
info
(
"Restarting
agent
via "
+
r
);
r
.
restart
();
}
catch
(
Exception
x
)
{
LOGGER
.
log
(
SEVERE
,
"Failed to restart
slave
with "
+
r
,
x
);
LOGGER
.
log
(
SEVERE
,
"Failed to restart
agent
with "
+
r
,
x
);
}
}
}
finally
{
// if we move on to the reconnection without restart,
// don't let the current implementations kick in when the
slave
loses connection again
// don't let the current implementations kick in when the
agent
loses connection again
restarters
.
clear
();
}
}
...
...
core/src/main/java/jenkins/slaves/restarter/SlaveRestarter.java
浏览文件 @
320e6c07
...
...
@@ -7,22 +7,22 @@ import java.io.Serializable;
import
java.util.logging.Logger
;
/**
* Extension point to control how to restart JNLP
slave
when it loses the connection with the master.
* Extension point to control how to restart JNLP
agent
when it loses the connection with the master.
*
* <p>
* Objects are instantiated on the master, then transferred to a
slave
via serialization.
* Objects are instantiated on the master, then transferred to a
n agent
via serialization.
*
* @author Kohsuke Kawaguchi
*/
public
abstract
class
SlaveRestarter
implements
ExtensionPoint
,
Serializable
{
/**
* Called on the
slave to see if this restarter can work on this slave
.
* Called on the
agent to see if this restarter can work on this agent
.
*/
public
abstract
boolean
canWork
();
/**
* If {@link #canWork()} method returns true, this method is called later when
* the connection is lost to restart the
slave
.
* the connection is lost to restart the
agent
.
*
* <p>
* Note that by the time this method is called, classloader is no longer capable of
...
...
@@ -32,8 +32,8 @@ public abstract class SlaveRestarter implements ExtensionPoint, Serializable {
*
* <p>
* This method is not expected to return, and the JVM should terminate before this call returns.
* If the method returns normally, the JNLP
slave
will move on to the reconnection without restart.
* If an exception is thrown, it is reported as an error and then the JNLP
slave
will move on to the
* If the method returns normally, the JNLP
agent
will move on to the reconnection without restart.
* If an exception is thrown, it is reported as an error and then the JNLP
agent
will move on to the
* reconnection without restart.
*/
public
abstract
void
restart
()
throws
Exception
;
...
...
core/src/main/java/jenkins/util/io/OnMaster.java
浏览文件 @
320e6c07
...
...
@@ -2,12 +2,12 @@ package jenkins.util.io;
/**
* Marks the objects in Jenkins that only exist in the core
* and not on
slave
s.
* and not on
agent
s.
*
* <p>
* This marker interface is for plugin developers to quickly
* tell if they can take a specific object from a master to
* a
slave
.
* a
n agent
.
*
* (Core developers, if you find classes/interfaces that extend
* from this, please be encouraged to add them.)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录