From 9c52e610af9667d69015cf5adcd69fef9a426807 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 18 Sep 2018 00:25:06 +0100 Subject: [PATCH] Jobs are being killed unexpectedly so remove potential source; Add more timeouts; Extend timeouts --- compile/eclipsebuild/eclipseds5build.gsh | 48 +++++++++++++----------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 5e1c0de..9fd5293 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -8,7 +8,7 @@ def doDisplayLeftovers() { ps aux | grep "eclipse" ps aux | grep "make" ps aux | grep "arm-linux" - ps aux | grep "sh" + # ps aux | grep "sh" """ } } @@ -121,8 +121,10 @@ def doBuild(apps, ds5folder, toolchainfolder, ds5shellcommand, buildcommand, sou // The lock is being used because it was being found that the doKillLeftovers was affecting other builds lock(resource: "eclipsebuild_${env.NODE_NAME}") { try { - addToolchainPath(toolchainfolder) - doImportProjects(ds5folder, toolchainfolder, ds5shellcommand, buildcommand, sourcefolder) + timeout(time: 2, unit: 'MINUTES') { + addToolchainPath(toolchainfolder) + doImportProjects(ds5folder, toolchainfolder, ds5shellcommand, buildcommand, sourcefolder) + } for (appInfo in apps ) { (build, cleanbuild, project, variants, exportpathlist) = appInfo if (build) { @@ -134,25 +136,30 @@ def doBuild(apps, ds5folder, toolchainfolder, ds5shellcommand, buildcommand, sou } for (build_variant in variants) { retry(maxprojectbuildretries) { // Eclipse occasionally raises exceptions (rather than the builds failing) - doDisplayLeftovers() - doRegisterToolchain(ds5folder, toolchainfolder) - echo "Build command: ${ds5shellcommand} \'${buildcommand} -no-indexer ${buildtype} \"${project}/${build_variant}\"\'" - if (isUnix()) { - timeout(time: 5, unit: 'MINUTES') { - sh """ - echo Start time: `date` - ${ds5shellcommand} \'${buildcommand} -no-indexer ${buildtype} \"${project}/${build_variant}\"\' - echo End time: `date` - """ + try { + doDisplayLeftovers() + doRegisterToolchain(ds5folder, toolchainfolder) + echo "Build command: ${ds5shellcommand} \'${buildcommand} -no-indexer ${buildtype} \"${project}/${build_variant}\"\'" + timeout(time: 10, unit: 'MINUTES') { + if (isUnix()) { + sh """ + echo Start time: `date` + ${ds5shellcommand} \'${buildcommand} -no-indexer ${buildtype} \"${project}/${build_variant}\"\' + echo End time: `date` + """ + } + else { + bat """ + "%ds5shellcommand%" "%buildcommand%" -no-indexer ${buildtype} "${project}\\${build_variant}" + """ + } } + doExport(exportfolder, exportpathlist, "", build_variant) + } catch (Exception e) { + echo "Build failed - Waiting for a while" sleep(time: 4, unit: 'SECONDS') + error "Build failed..." } - else { - bat """ - "%ds5shellcommand%" "%buildcommand%" -no-indexer ${buildtype} "${project}\\${build_variant}" - """ - } - doExport(exportfolder, exportpathlist, "", build_variant) } } } @@ -164,10 +171,9 @@ def doBuild(apps, ds5folder, toolchainfolder, ds5shellcommand, buildcommand, sou } } } catch (Exception e) { + // doKillLeftovers() error "Build failed - Killing leftovers" - doKillLeftovers() } - doKillLeftovers() } }