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
7
redo.py
7
redo.py
|
|
@ -62,9 +62,14 @@ try:
|
|||
err('invalid --jobs value: %r\n' % opt.jobs)
|
||||
jwack.setup(j)
|
||||
try:
|
||||
assert(state.is_flushed())
|
||||
retcode = builder.main(targets, lambda t: True)
|
||||
assert(state.is_flushed())
|
||||
finally:
|
||||
jwack.force_return_tokens()
|
||||
try:
|
||||
state.rollback()
|
||||
finally:
|
||||
jwack.force_return_tokens()
|
||||
sys.exit(retcode)
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(200)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue