Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing lock release error #537

Open
wants to merge 1 commit into
base: MOODLE_310_STABLE
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions classes/local/store/object_file_system.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ public function acquire_object_lock($contenthash, $timeout = 0) {
$lockfactory = \core\lock\lock_config::get_lock_factory('tool_objectfs_object');
$this->logger->start_timing();
$lock = $lockfactory->get_lock($resource, $timeout);
$lock->release();

Choose a reason for hiding this comment

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

This is not correct. You can't release the lock as soon as you get it. There must be a reason why the lock is not being released. We also found this bug ourselves.

$this->logger->end_timing();
$this->logger->log_lock_timing($lock);

Expand Down