From 637f63423a8afd4bfe143c985293df0345dae136 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Wed, 21 Nov 2018 19:21:02 -0500 Subject: [PATCH] Flush state data for a target before printing meta('do') for it. Extremely rarely, if that target had not yet previously been added to the redo database, redo-log would manage to run before the database got flushed, and then it would complain that the file is "not known to redo" and abort. I had to run "git clean -fdx; redo -j11 test" in a loop several hundred times before this race condition triggered, but it did trigger eventually. --- builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder.py b/builder.py index 8662d80..1125262 100644 --- a/builder.py +++ b/builder.py @@ -200,7 +200,6 @@ class BuildJob: # make sure to create the logfile *before* writing the log about it. # that way redo-log won't trace into an obsolete logfile. if vars.LOG: open(state.logname(self.sf.id), 'w') - meta('do', state.target_relpath(t)) self.dodir = dodir self.basename = basename self.ext = ext @@ -211,6 +210,7 @@ class BuildJob: dof.set_static() dof.save() state.commit() + meta('do', state.target_relpath(t)) jwack.start_job(t, self._do_subproc, self._after) def _start_unlocked(self, dirty):