I have found on some old moodle sites which have been around for a long time that if there are "orphaned" records in any module which has events then the adhoc task fails and starts over again on each cron run.
Here is a sample query that may help troubleshooting:
select * from mdl_assign where course not in (select id from mdl_course);
In my case I deleted the offending records as they were inaccessible anyway, up to you how you wish to resolve any you find.
Also, the adhoc task appears to be set up to run twice by existing in this table in two rows.
select * from mdl_task_adhoc;
So don't be surprised if it completes successfully then runs again anyway on the next cron execution.