Add a --debug-locks option.
Get rid of the "locked..." and "...unlocked!" messages by default, since they're not usually interesting. But add a new option to bring them back in case we end up with trouble debugging the locking stuff. (I don't really 100% trust it yet, although I haven't had a problem for a while now.)
This commit is contained in:
parent
4d47b5ec7f
commit
03a054ca79
3 changed files with 8 additions and 2 deletions
|
|
@ -127,7 +127,8 @@ def main(targets, buildfunc):
|
|||
lock = state.Lock(t)
|
||||
lock.trylock()
|
||||
if not lock.owned:
|
||||
log('%s (locked...)\n' % _nice(t))
|
||||
if vars.DEBUG_LOCKS:
|
||||
log('%s (locked...)\n' % _nice(t))
|
||||
locked.append(t)
|
||||
else:
|
||||
jwack.start_job(t, lock,
|
||||
|
|
@ -142,7 +143,8 @@ def main(targets, buildfunc):
|
|||
lock.wait()
|
||||
lock.trylock()
|
||||
assert(lock.owned)
|
||||
log('%s (...unlocked!)\n' % _nice(t))
|
||||
if vars.DEBUG_LOCKS:
|
||||
log('%s (...unlocked!)\n' % _nice(t))
|
||||
if state.stamped(t) == None:
|
||||
err('%s: failed in another thread\n' % _nice(t))
|
||||
retcode[0] = 2
|
||||
|
|
|
|||
3
redo.py
3
redo.py
|
|
@ -9,6 +9,7 @@ j,jobs= maximum number of jobs to build at once
|
|||
d,debug print dependency checks as they happen
|
||||
v,verbose print commands as they are run
|
||||
shuffle randomize the build order to find dependency bugs
|
||||
debug-locks print messages about file locking (useful for debugging)
|
||||
"""
|
||||
o = options.Options('redo', optspec)
|
||||
(opt, flags, extra) = o.parse(sys.argv[1:])
|
||||
|
|
@ -21,6 +22,8 @@ if opt.verbose:
|
|||
os.environ['REDO_VERBOSE'] = '1'
|
||||
if opt.shuffle:
|
||||
os.environ['REDO_SHUFFLE'] = '1'
|
||||
if opt.debug_locks:
|
||||
os.environ['REDO_DEBUG_LOCKS'] = '1'
|
||||
|
||||
is_root = not os.environ.get('REDO', '')
|
||||
|
||||
|
|
|
|||
1
vars.py
1
vars.py
|
|
@ -5,6 +5,7 @@ PWD = os.environ.get('REDO_PWD', '')
|
|||
TARGET = os.environ.get('REDO_TARGET', '')
|
||||
DEPTH = os.environ.get('REDO_DEPTH', '')
|
||||
DEBUG = atoi.atoi(os.environ.get('REDO_DEBUG', ''))
|
||||
DEBUG_LOCKS = os.environ.get('REDO_DEBUG_LOCKS', '') and 1 or 0
|
||||
VERBOSE = os.environ.get('REDO_VERBOSE', '') and 1 or 0
|
||||
SHUFFLE = os.environ.get('REDO_SHUFFLE', '') and 1 or 0
|
||||
STARTDIR = os.environ['REDO_STARTDIR']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue