From b1ca08fd0c632e07f84bd0ab6c8ddca36b2a0ab1 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 18 Jun 2020 09:54:18 +0100 Subject: [PATCH] handle EPIPE errors in CompileController --- app/js/CompileController.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/js/CompileController.js b/app/js/CompileController.js index e146b62..c76d0d5 100644 --- a/app/js/CompileController.js +++ b/app/js/CompileController.js @@ -55,6 +55,10 @@ module.exports = CompileController = { } else if (error instanceof Errors.FilesOutOfSyncError) { code = 409 // Http 409 Conflict status = 'retry' + } else if (error && error.code === 'EPIPE') { + // docker returns EPIPE when shutting down + code = 503 // send 503 Unavailable response + status = 'unavailable' } else if (error != null ? error.terminated : undefined) { status = 'terminated' } else if (error != null ? error.validate : undefined) {