File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
main/java/io/kubernetes/client/extended/controller
test/java/io/kubernetes/client/extended/controller Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,13 @@ private void worker() {
151
151
log .debug ("Controller {} start reconciling {}.." , this .name , request );
152
152
153
153
// do reconciliation, invoke user customized logic.
154
- Result result = this .reconciler .reconcile (request );
154
+ Result result = null ;
155
+ try {
156
+ result = this .reconciler .reconcile (request );
157
+ } catch (Throwable t ) {
158
+ log .error ("Reconciler aborted unexpectedly" , t );
159
+ result = new Result (true );
160
+ }
155
161
156
162
try {
157
163
// checks whether do a re-queue (on failure)
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ public void testControllerWontStartBeforeReady() throws InterruptedException {
103
103
}
104
104
105
105
@ Test
106
- public void testControllerStopsWorkingWhenReconcilerAbortsWithRuntimeException ()
106
+ public void testControllerKeepsWorkingWhenReconcilerAbortsWithRuntimeException ()
107
107
throws InterruptedException {
108
108
AtomicBoolean aborts = new AtomicBoolean (true );
109
109
AtomicBoolean resumed = new AtomicBoolean (false );
@@ -135,9 +135,10 @@ public Result reconcile(Request request) {
135
135
// emit another event, the previous one has been backoff'd
136
136
Request request2 = new Request ("test2" );
137
137
workQueue .add (request2 );
138
+ cooldown ();
138
139
testController .shutdown ();
139
140
140
- assertFalse (resumed .get ());
141
- assertEquals ( 0 , finishedRequests .size ());
141
+ assertTrue (resumed .get ());
142
+ assertTrue ( finishedRequests .size () >= 1 );
142
143
}
143
144
}
You can’t perform that action at this time.
0 commit comments