Moodle

cron locking is based on guesswork

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9
  • Component/s: Administration
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

rewrite cron locking to use expiration time in value instead of guessing when we can dispose it later
simplify/rewrite the locking code

set_time_limit() MUST be used together with locks

Activity

Hide
Petr Škoda (skodak) added a comment -

The rewritten locking allows code to lock something for specific time, it is highly recommended to use it in combination with set_time_limit(). The scrip execution limit should be lowered a bit to guarantee that the code is not executing anymore when the lock is considered to be already released. Code may extend the lock duration now.

Benefits:
1/ much easier to use
2/ set_time_limit() improves the locking logic

Show
Petr Škoda (skodak) added a comment - The rewritten locking allows code to lock something for specific time, it is highly recommended to use it in combination with set_time_limit(). The scrip execution limit should be lowered a bit to guarantee that the code is not executing anymore when the lock is considered to be already released. Code may extend the lock duration now. Benefits: 1/ much easier to use 2/ set_time_limit() improves the locking logic
Hide
Petr Škoda (skodak) added a comment -

done

Show
Petr Škoda (skodak) added a comment - done

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: