Skip to content

Commit 9d6ec1f

Browse files
committed
Fix: should not return from DefaultController.worker() method when requeue is true and add lacked arguments to format string
1 parent 774157f commit 9d6ec1f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

extended/src/main/java/io/kubernetes/client/extended/controller/DefaultController.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,16 @@ public DefaultController(
5656
// preFlightCheck checks if the controller is ready for working.
5757
private boolean preFlightCheck() {
5858
if (workerCount <= 0) {
59-
log.error("Fail to start controller {}: worker count must be positive.");
59+
log.error("Fail to start controller {}: worker count must be positive.", this.name);
6060
return false;
6161
}
6262
if (workerThreadPool == null) {
63-
log.error("Fail to start controller {}: missing worker thread-pool.");
63+
log.error("Fail to start controller {}: missing worker thread-pool.", this.name);
6464
return false;
6565
}
6666
if (!isReady()) {
67-
log.error("Timed out waiting for cache to be synced.");
67+
log.error(
68+
"Fail to start controller {}: Timed out waiting for cache to be synced.", this.name);
6869
return false;
6970
}
7071
return true;
@@ -143,10 +144,10 @@ private void worker() {
143144
}
144145
// request is expected to be null, when the work-queue is shutting-down.
145146
if (request == null) {
146-
log.info("Controller {} worker exiting because work-queue has shutdown..");
147+
log.info("Controller {} worker exiting because work-queue has shutdown..", this.name);
147148
return;
148149
}
149-
log.debug("Controller {} start reconciling {}..", request);
150+
log.debug("Controller {} start reconciling {}..", this.name, request);
150151

151152
// do reconciliation, invoke user customized logic.
152153
Result result = this.reconciler.reconcile(request);
@@ -155,22 +156,22 @@ private void worker() {
155156
// checks whether do a re-queue (on failure)
156157
if (result.isRequeue()) {
157158
if (result.getRequeueAfter() == null) {
158-
log.debug("Controller {} reconciling {} failed, requeuing {}..", request);
159+
log.debug("Controller {} reconciling {} failed, requeuing {}..", this.name, request);
159160
workQueue.addRateLimited(request);
160161
} else {
161162
log.debug(
162163
"Controller {} reconciling {} failed, requeuing after {}..",
164+
this.name,
163165
request,
164166
result.getRequeueAfter());
165167
workQueue.addAfter(request, result.getRequeueAfter());
166168
}
167-
return;
168169
} else {
169170
workQueue.forget(request);
170171
}
171172
} finally {
172173
workQueue.done(request);
173-
log.debug("Controller {} finished reconciling {}..", request);
174+
log.debug("Controller {} finished reconciling {}..", this.name, request);
174175
}
175176
}
176177
}

0 commit comments

Comments
 (0)