Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions reframe/frontend/reporting/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ def _db_lock(self):
# filelock 3.10
kwargs = {}

# Create parent directories of the lock file
#
# NOTE: This is not necessary for filelock >= 3.12.3 and Python >= 3.8
# However, we do create it here, in order to support the older Python
# versions.
os.makedirs(prefix, exist_ok=True)
return FileLock(os.path.join(prefix, '.db.lock'), **kwargs)

def _db_create(self):
Expand Down Expand Up @@ -223,8 +229,8 @@ def _db_store_report(self, conn, report, report_file_path):
return session_uuid

def store(self, report, report_file=None):
with self._db_connect(self._db_file()) as conn:
with self._db_lock():
with self._db_lock():
with self._db_connect(self._db_file()) as conn:
return self._db_store_report(conn, report, report_file)

@time_function
Expand Down
Loading