Skip to content

cache_cleaner task fails because of the use of redis #246

Open
@srobotta

Description

@srobotta

We have the coderunner version 5.6.2 2025022300 on a Moodle 4.6 installation. The cache cleaner task fails since then:

Execute scheduled task: Purge Old Coderunner Cache Entries - task (qtype_coderunner\task\cache_cleaner)
... started 13:25:29. Current memory use 17.4 MB.
Debugging increased temporarily due to faildelay of 86400
... used 0 dbqueries
... used 0.013164043426514 seconds
Scheduled task failed: Purge Old Coderunner Cache Entries - task (qtype_coderunner\task\cache_cleaner),Strange... the Coderunner grading cache file store cannot be found!?
Backtrace:
* line 94 of /question/type/coderunner/classes/cache_purger.php: call to qtype_coderunner\cache_purger::get_first_file_store()
* line 66 of /question/type/coderunner/classes/task/cache_cleaner.php: call to qtype_coderunner\cache_purger->__construct()
* line 410 of /lib/classes/cron.php: call to qtype_coderunner\task\cache_cleaner->execute()
* line 194 of /admin/cli/scheduled_task.php: call to core\cron::run_inner_scheduled_task()

What I have figured out is, that the task assumes that there is a flle cache in use and deletes files that exceed the given ttl (from the coderunner settings qtype_coderunner | gradecachettl).

First of all, the deletion of cache entries should be handled by the cache itself. I assume this task from coderunner exists because of some bug in the file cache.
The redis cache in Moodle (that we use) implements the same interfaces as the file cache, so these two should be exchangeable. However, the task accesses a private function via a reflection class of the file cache, that exists in this class only.

Could you please check, if that manual cleanup of files is still needed and in case not, remove the manual work there? In my opinion the task doesn't make much sense and seems to be there for historic reasons.

I have disabled the task, also because we do not have the setting qtype_coderunner | enablegradecache enabled at our site, hence we don't use the cache at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions