@@ -256,7 +256,7 @@ public NextAction apply(Packet packet) {
256
256
// be available for reading
257
257
if (isJobFailed && "DeadlineExceeded" .equals (getFailedReason (job ))) {
258
258
fiber .terminate (
259
- new DeadlineExceededException (job . getMetadata (). getName () ), packet );
259
+ new DeadlineExceededException (job ), packet );
260
260
}
261
261
fiber .resume (packet );
262
262
}
@@ -304,15 +304,37 @@ public NextAction onSuccess(
304
304
}
305
305
306
306
static class DeadlineExceededException extends Exception {
307
- final String job ;
307
+ final V1Job job ;
308
308
309
- public DeadlineExceededException (String job ) {
309
+ public DeadlineExceededException (V1Job job ) {
310
310
super ();
311
311
this .job = job ;
312
312
}
313
313
314
314
public String toString () {
315
- return "Job " + job + " failed. Reason: DeadlineExceeded" ;
315
+ StringBuilder sb = new StringBuilder ("Job " )
316
+ .append (job .getMetadata ().getName ()).append (" failed due to reason: DeadlineExceeded." )
317
+ .append (" ActiveDeadlineSeconds of the job is configured with "
318
+ + job .getSpec ().getActiveDeadlineSeconds ()
319
+ + " seconds." )
320
+ .append (getJobStartedSecondsMessage ())
321
+ .append (" Ensure all domain dependencies have been deployed" )
322
+ .append (" (any secrets, config-maps, PVs, and PVCs that the domain resource references)." )
323
+ .append (" Use kubectl describe the job and its pod for more job failure information." )
324
+ .append (" The job may be retried by the operator up to "
325
+ + DomainPresence .getDomainPresenceFailureRetryMaxCount ()
326
+ + " times with longer ActiveDeadlineSeconds value in each subsequent retry." )
327
+ .append (" Use tuning parameter \" domainPresenceFailureRetryMaxCount\" to configure max retries." );
328
+ return sb .toString ();
329
+ }
330
+
331
+ private String getJobStartedSecondsMessage () {
332
+ if (job .getStatus () != null && job .getStatus ().getStartTime () != null ) {
333
+ return " The job was started "
334
+ + ((System .currentTimeMillis () - job .getStatus ().getStartTime ().getMillis ()) / 1000 )
335
+ + " seconds ago." ;
336
+ }
337
+ return null ;
316
338
}
317
339
}
318
340
}
0 commit comments