almost always, if a shell command fails, the dispatcher should stop

Bug #901039 reported by Michael Hudson-Doyle
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
LAVA Dispatcher
Fix Released
Critical
Michael Hudson-Doyle

Bug Description

We've had a few problems where an important command has failed during deployment but we've carried on regardless. We should fail instead. There are a few commands we expect to fail some of the time -- these can be explicitly allowed to fail somehow.

Related branches

Revision history for this message
Le Chi Thu (le-chi-thu) wrote :

Dispatcher fail to detect lava-installation error.

http://validation.linaro.org/lava-server/scheduler/job/12687

root@master:~# [rc=0]: <LAVA_DISPATCHER>2012-02-17 09:02:48 PM DEBUG: sendline : chroot /mnt/testrootfs lava-test install build-gcc-181350
chroot /mnt/testrootfs lava-test install build-gcc-181350
<LAVA_DISPATCHER>2012-02-17 09:02:50 PM DEBUG: expect (2400): 'root@master:'
chroot /mnt/testrootfs lava-test install build-gcc-18135 0
LAVA: Downloading file from: u'http://people.linaro.org/~ams/gcc-svn-181350.tar.bz2'
LAVA: Running shell command: u'tar xf gcc-svn-181350.tar.bz2 --checkpoint=1000'
LAVA: (stderr) tar (child): lbzip2: Cannot exec: No such file or directory
LAVA: (stderr) tar (child): Error is not recoverable: exiting now
LAVA: (stderr) tar: Child returned status 2
LAVA: (stderr) tar: Error is not recoverable: exiting now
ERROR: Command 'tar xf gcc-svn-181350.tar.bz2 --checkpoint=1000' returned non-zero exit status 2
root@master:~# [rc=1]: <LAVA_DISPATCHER>2012-02-17 09:05:43 PM DEBUG: sendline : chroot /mnt/testrootfs rm -rf lava-test

Changed in lava-dispatcher:
importance: Undecided → Critical
assignee: nobody → Le Chi Thu (le-chi-thu)
Le Chi Thu (le-chi-thu)
Changed in lava-dispatcher:
assignee: Le Chi Thu (le-chi-thu) → Michael Hudson-Doyle (mwhudson)
Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote :

Assuming that commands are executed in a shell, an individual command can be allowed to fail like this:

   command that might fail || true

so, if it fails it runs "true", so the command as a whole gives success.

Equally, it could be:

   command || echo "COMMAND FAILED"

The echo completes successfully, so the whole commands always reports success.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote : Re: [Bug 901039] Re: almost always, if a shell command fails, the dispatcher should stop

On Mon, 27 Feb 2012 11:22:26 -0000, Andrew Stubbs <email address hidden> wrote:
> Assuming that commands are executed in a shell, an individual command
> can be allowed to fail like this:
>
> command that might fail || true
>
> so, if it fails it runs "true", so the command as a whole gives success.
>
> Equally, it could be:
>
> command || echo "COMMAND FAILED"
>
> The echo completes successfully, so the whole commands always reports
> success.

Err. We all know that :-)

Fathi Boudra (fboudra)
Changed in lava-dispatcher:
status: New → Triaged
milestone: none → 2012.03
Paul Larson (pwlars)
Changed in lava-dispatcher:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.