Skip to content

Commit

Permalink
Builder: Bugfixes
Browse files Browse the repository at this point in the history
The builder mistook a gcc command line option for an error message.
Also, the pilot could get stuck in an infinite loop if run while
a distributed task was only partially done on the clients.
  • Loading branch information
skyjake committed Jan 11, 2012
1 parent 565e555 commit 4a7148f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion distrib/builder/utils.py
@@ -1,4 +1,5 @@
import os, sys, platform
import string
import glob
import gzip
import codecs
Expand Down Expand Up @@ -62,7 +63,7 @@ def count_log_word(fn, word):
while True:
pos = txt.find(unicode(word), pos)
if pos < 0: break
if txt[pos-1] not in '/\\_' and txt[pos+len(word)] != 's' and \
if txt[pos-1] not in '/\\_'+string.ascii_letters and txt[pos+len(word)] != 's' and \
txt[pos-11:pos] != 'shlibdeps: ':
count += 1
pos += len(word)
Expand Down
8 changes: 6 additions & 2 deletions distrib/pilot.py
Expand Up @@ -142,6 +142,7 @@ def listTasks(clientId=None, includeCompleted=True, onlyCompleted=False,

for name in os.listdir(homeDir()):
fn = os.path.join(homeDir(), name)
if fn == '.' or fn == '..': continue

# All tasks are specific to a client.
if os.path.isdir(fn) and (name == clientId or allClients):
Expand All @@ -156,7 +157,7 @@ def listTasks(clientId=None, includeCompleted=True, onlyCompleted=False,
tasks = filter(lambda n: not n.endswith('.done'), tasks)

if onlyCompleted:
tasks = filter(lambda n: n.endswith('.done'), tasks)
tasks = filter(lambda n: isTaskComplete(n), tasks)

tasks.sort()
return tasks
Expand Down Expand Up @@ -292,7 +293,7 @@ def handleCompletedTasks():
if len(tasks) == 0: break

task = tasks[0][:-5] # Remove '.done'
if not isTaskComplete(task): continue
assert isTaskComplete(task)

clearTask(task)

Expand Down Expand Up @@ -366,6 +367,9 @@ def clearTask(name, direc=None):


def isTaskComplete(name):
# Remote the possible '.done' suffix.
if name[-5:] == '.done': name = name[:-5]
# Check that everyone has completed it.
for task in listTasks(allClients=True):
if task.startswith(name) and not task.endswith('.done'):
# This one is not complete.
Expand Down

0 comments on commit 4a7148f

Please sign in to comment.