The persisting of state in https://github.com/okfn/ofs/blob/master/ofs/local/storedjson.py#L12 has been causing issues where the file will be corrupted, or overwritten with incorrect data by another process. There is nothing stopping one process/thread from writing to the file whilst another process is also trying to write (there is a race between reading/writing).
State should be persisted somewhere other than a file on disk. Setting O_EXCL on the fd isn't a safe solution (it'll just show up as blocked/sleeping processes waiting for access).