Fix the lock release on stale locks

Closes #3598231

Merge request reports

Loading