moodle version 3.6.2, php 7.2 nts, Windows
I using task scheduler for running cron daily, when i check on moodle scheduledtasks
I notice the task completion_regular_task is stuck ( when i run on web it’s say Cannot obtain task lock ).
After deep searching, I notice when cron is running specially on
it’s stop and stuck there, I left for 24 hours and still stuck there, when i check on db mdl_lock_db task completion_regular_task is stuck and when I check on process db ssms
Execute scheduled task: Calculate regular completion data (coretaskcompletion_regular_task)
... started 00:15:48. Current memory use 23.2MB.
Starting course completion batch processing...
>> Processed 0 records.
>> Completion cron finished.
`
SELECT
r.session_id AS VictimSession,
r.blocking_session_id AS BlockingSession,
r.wait_type,
r.wait_time,
r.last_wait_type,
r.status,
r.command,
r.wait_resource,
st.text AS RunningSQL
FROM sys.dm_exec_requests r
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) st
WHERE r.blocking_session_id <> 0;
`
VictimSession | BlockingSession | wait_type | wait_time | last_wait_type | status | command
52 | 52 | LCK_M_IX | 10768 | LCK_M_IX | suspended | UPDATE
- purge cache moodle
- delete file on moodledata (like cache, session, lock,temp)
- Debug on config moodle, show all error add some code like try and catch (to check if it’s work or not, the code is showing but it’s stuck again)
- check on log php and log moodle (got nothing, it’s not error)
- add index on table (maybe the data on db is too much)
- check on forum moodle (find nothing)
I though it’s because I using NFS and it’s locking (race condition), but even after I put moodledata on local server it’s still got same result, I only test cron on 1 server (other is shutdown, to make sure no double run cron)
my case is exactly same like this
This never happen before and usually after purgecache everything is back to normal.
Already stuck almost 2 weeks and still no clue for fixing this problem any idea?