I have a project where I’m running some commands on the server which occasionally get hung up and never complete. Specifically, it’s a DOS Command/Batch File which has several manual calls to NPM, Bower & Gulp. These should only take a few minutes to run, but occasionally things go sideways and my batch file never completes. I’ve had cases where the build will hang for nearly a day before it gets noticed. The commands are really straightforward:
CALL npm install
CALL npm install bower
CALL node_modules.bin\bower install
CALL node_modules.bin\gulp
I know that this particular command shouldn’t take more than about a minute or two to complete. 3-4 minutes should be more than sufficient. Is there a way to add a timeout to a specific Action? Or to the entire stage?
I’ve tried to implement my own timer and it didn’t work. I used a While loop and a counter to 300 seconds, deselected the “Wait for completion” option and had the batch file create a new file when it was completed. If I ran the batch file manually, it worked fine and wrote both a “gulpStarted.txt” and a “gulpCompleted” file. But if I run the same batch file using Continua, it never seemed to write the second file indicating it completed so deselecting the “Wait for completion” and a custom counter/timer doesn’t seem to be a workaround that I can use. I also poked around to see if there was any kind of executable utility I could use to call my batch file which would kill it if it didn’t complete after a certain time period but outside of a Windows scheduled task, it didn’t like there were any easy options.
As a sidenote, I realize that there are specific actions for NPM, Gulp and Bower that can be used, but not until after I’d created the batch file and was calling things from there so perhaps that would solve the issue but I don’t see timeout settings on those either.
Any ideas would be appreciated. Thanks!
Hi Mike,
We’ve got timeouts for actions on the to-do list.
Currently you can use a FinalBuilder script to run the batch file (or npm/bower/gulp actions) and call this from Continua CI. This will allow you to add timeout (and retry) options to the actions.