From 579975f08de3315d6e8cf29b0219a9e3afd03cb5 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Sun, 12 Jan 2020 16:41:09 -0500 Subject: [PATCH] engine: graph: Don't error when state file is missing For some reason we get errors when we try to remove a non-existent state file. There's a slight possibility that it could be a bug we're working around, but it's not clear that this is the case, and I think it's possible that a state file could have gotten nuked by the user somehow, although this was occurring "naturally" when running reverse1.mcl so let's keep that working for now. --- engine/graph/reverse.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/graph/reverse.go b/engine/graph/reverse.go index 862a1094..18d0d6cd 100644 --- a/engine/graph/reverse.go +++ b/engine/graph/reverse.go @@ -291,5 +291,10 @@ func (obj *State) ReversalDelete() error { } file := path.Join(dir, ReverseFile) // return a unique file - return errwrap.Wrapf(os.Remove(file), "could not remove reverse state file") + // FIXME: why do we see these removals when there isn't a state file? + if err = os.Remove(file); os.IsNotExist(err) { + return nil // ignore missing files + } + + return errwrap.Wrapf(err, "could not remove reverse state file") }