28
28
*
29
29
* <p>
30
30
* This substantially improves the performance by reducing the amount of data that needs to be transferred.
31
- * One cache will be built on the Hudson master , then per-slave cache is cloned from there.
31
+ * One cache will be built on the Hudson controller , then per-agent cache is cloned from there.
32
32
*
33
33
* @see HUDSON-4794: manages repository caches.
34
34
* @author Jesse Glick
@@ -73,8 +73,8 @@ private Cache(String remote, String hash, StandardUsernameCredentials credential
73
73
}
74
74
75
75
/**
76
- * Gets a lock for the given slave node.
77
- * @param node Name of the slave node.
76
+ * Gets a lock for the given agent node.
77
+ * @param node Name of the agent node.
78
78
* @return The {@link ReentrantLock} instance.
79
79
*/
80
80
private synchronized ReentrantLock getLockForSlaveNode (String node ) {
@@ -95,19 +95,19 @@ private synchronized ReentrantLock getLockForSlaveNode(String node) {
95
95
* The node that gets a local cached repository.
96
96
*
97
97
* @return
98
- * The file path on the {@code node} to the local repository cache, cloned off from the master cache.
98
+ * The file path on the {@code node} to the local repository cache, cloned off from the controller cache.
99
99
*/
100
100
@ CheckForNull FilePath repositoryCache (MercurialInstallation inst , Node node , Launcher launcher , TaskListener listener , boolean useTimeout )
101
101
throws IOException , InterruptedException {
102
102
boolean masterWasLocked = masterLock .isLocked ();
103
103
if (masterWasLocked ) {
104
- listener .getLogger ().println ("Waiting for master lock on hgcache/" + hash + " " + masterLock + "..." );
104
+ listener .getLogger ().println ("Waiting for controller lock on hgcache/" + hash + " " + masterLock + "..." );
105
105
}
106
106
107
- // Always update master cache first.
107
+ // Always update controller cache first.
108
108
final Node master = Jenkins .getInstance ();
109
109
if (master == null ) { // Should not happen
110
- throw new IOException ("Cannot retrieve the Jenkins master node" );
110
+ throw new IOException ("Cannot retrieve the Jenkins controller node" );
111
111
}
112
112
113
113
FilePath masterCaches = null ;
@@ -116,23 +116,23 @@ private synchronized ReentrantLock getLockForSlaveNode(String node) {
116
116
} else {
117
117
FilePath rootPath = master .getRootPath ();
118
118
if (rootPath == null ) {
119
- throw new IOException ("Cannot retrieve the root directory of the Jenkins master node" );
119
+ throw new IOException ("Cannot retrieve the root directory of the Jenkins controller node" );
120
120
}
121
121
masterCaches = rootPath .child ("hgcache" );
122
122
}
123
123
124
124
FilePath masterCache = masterCaches .child (hash );
125
125
Launcher masterLauncher = node == master ? launcher : master .createLauncher (listener );
126
126
127
- // hg invocation on master
127
+ // hg invocation on controller
128
128
// do we need to pass in EnvVars from a build too?
129
129
try (HgExe masterHg = new HgExe (inst , credentials , masterLauncher , master , listener , new EnvVars ())) {
130
- // Lock the block used to verify we end up having a cloned repo in the master ,
130
+ // Lock the block used to verify we end up having a cloned repo in the controller ,
131
131
// whether if it was previously cloned in a different build or if it's
132
132
// going to be cloned right now.
133
133
masterLock .lockInterruptibly ();
134
134
try {
135
- listener .getLogger ().println ("Acquired master cache lock." );
135
+ listener .getLogger ().println ("Acquired controller cache lock." );
136
136
// TODO use getCredentials()
137
137
if (masterCache .isDirectory ()) {
138
138
ArgumentListBuilder args = masterHg .seed (true ).add ("pull" );
@@ -150,27 +150,27 @@ private synchronized ReentrantLock getLockForSlaveNode(String node) {
150
150
}
151
151
} finally {
152
152
masterLock .unlock ();
153
- listener .getLogger ().println ("Master cache lock released." );
153
+ listener .getLogger ().println ("Controller cache lock released." );
154
154
}
155
155
if (node == master ) {
156
156
return masterCache ;
157
157
}
158
- // Not on master , so need to create/update local cache as well.
158
+ // Not on controller , so need to create/update local cache as well.
159
159
160
- // We are in a slave node that will need also an updated local cache: clone it or
160
+ // We are in a agent node that will need also an updated local cache: clone it or
161
161
// pull pending changes, if any. This can be safely done in parallel in
162
- // different slave nodes for a given repo, so we'll use different
162
+ // different agent nodes for a given repo, so we'll use different
163
163
// node-specific locks to achieve this.
164
164
ReentrantLock slaveNodeLock = getLockForSlaveNode (node .getNodeName ());
165
165
166
166
boolean slaveNodeWasLocked = slaveNodeLock .isLocked ();
167
167
if (slaveNodeWasLocked ) {
168
- listener .getLogger ().println ("Waiting for slave node cache lock in " + node .getNodeName () + " on hgcache/" + hash + " " + slaveNodeWasLocked + "..." );
168
+ listener .getLogger ().println ("Waiting for agent node cache lock in " + node .getNodeName () + " on hgcache/" + hash + " " + slaveNodeWasLocked + "..." );
169
169
}
170
170
171
171
slaveNodeLock .lockInterruptibly ();
172
172
try {
173
- listener .getLogger ().println ("Acquired slave node cache lock for node " + node .getNodeName () + "." );
173
+ listener .getLogger ().println ("Acquired agent node cache lock for node " + node .getNodeName () + "." );
174
174
175
175
final FilePath nodeRootPath = node .getRootPath ();
176
176
if (nodeRootPath == null ) {
@@ -186,7 +186,7 @@ private synchronized ReentrantLock getLockForSlaveNode(String node) {
186
186
FilePath masterTransfer = masterCache .child (bundleFileName );
187
187
FilePath localTransfer = localCache .child ("xfer.hg" );
188
188
try {
189
- // hg invocation on the slave
189
+ // hg invocation on the agent
190
190
try (HgExe slaveHg = new HgExe (inst , credentials , launcher , node , listener , new EnvVars ())) {
191
191
if (localCache .isDirectory ()) {
192
192
// Need to transfer just newly available changesets.
@@ -195,8 +195,8 @@ private synchronized ReentrantLock getLockForSlaveNode(String node) {
195
195
if (localHeads .equals (masterHeads )) {
196
196
listener .getLogger ().println ("Local cache is up to date." );
197
197
} else {
198
- // If there are some local heads not in master , they must be ancestors of new heads.
199
- // If there are some master heads not in local, they could be descendants of old heads,
198
+ // If there are some local heads not in controller , they must be ancestors of new heads.
199
+ // If there are some controller heads not in local, they could be descendants of old heads,
200
200
// or they could be new branches.
201
201
// Issue1910: in Hg 1.4.3 and earlier, passing --base $h for h in localHeads will fail
202
202
// to actually exclude those head sets, but not a big deal. (Hg 1.5 fixes that but leaves
@@ -235,7 +235,7 @@ private synchronized ReentrantLock getLockForSlaveNode(String node) {
235
235
return localCache ;
236
236
} finally {
237
237
slaveNodeLock .unlock ();
238
- listener .getLogger ().println ("Slave node cache lock released for node " + node .getNodeName () + "." );
238
+ listener .getLogger ().println ("agent node cache lock released for node " + node .getNodeName () + "." );
239
239
}
240
240
}
241
241
}
0 commit comments