ICIJ / ICIJ/icij-python

fix: re-implement lock for `DBMixin`

Open
#9 0 comments 0 reactions 1 assignee View on GitHub

@ClemDoum is already working on this.

Since Jun 19, 2024.

Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Bug description

On some OS, there seem to be race conditions in the JSON DB serialized on the filesystem leading to failures such as this one.

To avoid read/writing to the DB at the same time, the DBMixin should read/write with lock.
This behavior was implemented earlier with a thread.Lock but has been remove has the lock is not serializable accross processes and hence don't worker properly with multiprocessing workers.

Leveraing filelock could be a potential fix for this issue.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.