summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-12-10 09:05:23 -0700
committerSimon Glass <sjg@chromium.org>2019-01-14 17:47:13 -0700
commite74429bb17533c454b804e523ff5724344711ad2 (patch)
treee5b76fa7f46cfdc203970338b1955a0ae4a70e13 /tools
parentdf9cf1cc08d73af765f0f434909295ac6fed2c4b (diff)
buildman: Deal nicely with invalid build-status file
The 'done' files created by buildman may end up being empty if buildman runs out of disk space while writing them. This error is then persistent, since even if disk space is reclaimed and the build retries, the empty file causes an exception in the builder thread. Deal with this silently by doing a rebuild. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/buildman/builderthread.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
index c84ba6acf1..b91634f3ab 100644
--- a/tools/buildman/builderthread.py
+++ b/tools/buildman/builderthread.py
@@ -156,7 +156,12 @@ class BuilderThread(threading.Thread):
if result.already_done:
# Get the return code from that build and use it
with open(done_file, 'r') as fd:
- result.return_code = int(fd.readline())
+ try:
+ result.return_code = int(fd.readline())
+ except ValueError:
+ # The file may be empty due to running out of disk space.
+ # Try a rebuild
+ result.return_code = RETURN_CODE_RETRY
# Check the signal that the build needs to be retried
if result.return_code == RETURN_CODE_RETRY: