Add more assertions about uncommitted sqlite transactions.
I think we were sometimes leaving half-done sqlite transactions sitting around for a long time (eg. across sub-calls to .do files). This seemed to be okay on Linux, but caused sqlite deadlocks on MacOS. Most likely it's not the operating system, but the sqlite version and journal mode in use. In any case, the correct thing to do is to actually commit or rollback transactions, not leave them hanging around. ...unfortunately this doesn't actually fix my MacOS deadlocks, which makes me rather nervous.
This commit is contained in:
parent
74f968d6ca
commit
613625b580
5 changed files with 35 additions and 2 deletions
|
|
@ -203,6 +203,7 @@ class BuildJob:
|
|||
# redo-ifchange, and it might have done it from a different directory
|
||||
# than we started it in. So os.getcwd() might be != REDO_PWD right
|
||||
# now.
|
||||
assert(state.is_flushed())
|
||||
dn = self.dodir
|
||||
newp = os.path.realpath(dn)
|
||||
os.environ['REDO_PWD'] = state.relpath(newp, vars.STARTDIR)
|
||||
|
|
@ -319,6 +320,7 @@ def main(targets, shouldbuildfunc):
|
|||
seen = {}
|
||||
lock = None
|
||||
for t in targets:
|
||||
assert(state.is_flushed())
|
||||
if t in seen:
|
||||
continue
|
||||
seen[t] = 1
|
||||
|
|
@ -343,6 +345,8 @@ def main(targets, shouldbuildfunc):
|
|||
locked.append((f.id,t))
|
||||
else:
|
||||
BuildJob(t, f, lock, shouldbuildfunc, done).start()
|
||||
state.commit()
|
||||
assert(state.is_flushed())
|
||||
|
||||
del lock
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue