File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed
apps/kubernetes-provider/src Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ export class TaskMonitor {
140140 const containerState = this . #getContainerStateSummary( containerStatus . state ) ;
141141 const exitCode = containerState . exitCode ?? - 1 ;
142142
143- if ( exitCode === EXIT_CODE_ALREADY_HANDLED ) {
143+ if ( exitCode === EXIT_CODE_ALREADY_HANDLED || exitCode === EXIT_CODE_CHILD_NONZERO ) {
144144 this . #logger. debug ( "Ignoring pod failure, already handled by worker" , {
145145 podName,
146146 } ) ;
@@ -186,9 +186,8 @@ export class TaskMonitor {
186186 break ;
187187 case "OOMKilled" :
188188 overrideCompletion = true ;
189- reason = `${
190- exitCode === EXIT_CODE_CHILD_NONZERO ? "Child process" : "Parent process"
191- } ran out of memory! Try choosing a machine preset with more memory for this task.`;
189+ reason =
190+ "[TaskMonitor] Your task ran out of memory. Try increasing the machine specs. If this doesn't fix it there might be a memory leak." ;
192191 errorCode = TaskRunErrorCodes . TASK_PROCESS_OOM_KILLED ;
193192 break ;
194193 default :
Original file line number Diff line number Diff line change @@ -519,12 +519,12 @@ class ProdWorker {
519519
520520 logger . log ( "completion acknowledged" , { willCheckpointAndRestore, shouldExit } ) ;
521521
522- const exitCode =
522+ const isNonZeroExitError =
523523 ! completion . ok &&
524524 completion . error . type === "INTERNAL_ERROR" &&
525- completion . error . code === TaskRunErrorCodes . TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE
526- ? EXIT_CODE_CHILD_NONZERO
527- : 0 ;
525+ completion . error . code === TaskRunErrorCodes . TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE ;
526+
527+ const exitCode = isNonZeroExitError ? EXIT_CODE_CHILD_NONZERO : 0 ;
528528
529529 if ( shouldExit ) {
530530 // Exit after completion, without any retrying
Original file line number Diff line number Diff line change 1+ /** This was used by the old build system in case of indexing failures */
12export const EXIT_CODE_ALREADY_HANDLED = 111 ;
2- export const EXIT_CODE_CHILD_NONZERO = 112 ;
3+ /** This means what it says and is only set once we have completed the attempt */
4+ export const EXIT_CODE_CHILD_NONZERO = 112 ;
You can’t perform that action at this time.
0 commit comments