Skip to content
Closed
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
8 changes: 7 additions & 1 deletion web/server/codechecker_server/api/mass_store_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,15 @@ def __free_run_lock(self, session: DBSession):
""" Remove the lock from the database for the given run name. """
# Using with_for_update() here so the database (in case it supports
# this operation) locks the lock record's row from any other access.
# The "nowait" option is turned off, because it results a 'could not
# obtain lock on row in relation "run_locks"' error message in case
# this query happens simultaneously with a concurrent locking of
# another parallel store event. With "nowait" option the query will be
# blocked until the lock is undone. In the worst case when
# statement_timeout is reached, the exception will be thrown anyway.
run_lock = session.query(RunLock) \
.filter(RunLock.name == self.__name) \
.with_for_update(nowait=True).one()
.with_for_update(nowait=False).one()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should only this one usage site be modified?

session.delete(run_lock)
session.commit()

Expand Down