-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.0
-
MOODLE_400_STABLE
-
MDL-72729-master-sendmessage_disabled_processors
-
I found the following frequent failures in my task logs report while reviewing MDL-72691:
Looking into it, I discovered that the "Subscribed forum posts" message provider on my site had been deliberately disabled:
This causes message_send to return false: https://github.com/moodle/moodle/blob/1a9bee69e60f687bcaf4db0569665f4186c515a4/lib/messagelib.php#L56-L71 - resulting in $errorcount increasing: https://github.com/moodle/moodle/blob/1a9bee69e60f687bcaf4db0569665f4186c515a4/mod/forum/classes/task/send_user_notifications.php#L155-L166 and eventually an exception: https://github.com/moodle/moodle/blob/1a9bee69e60f687bcaf4db0569665f4186c515a4/mod/forum/classes/task/send_user_notifications.php#L182-L185 - example from task logs:
Execute adhoc task: mod_forum\task\send_user_notifications
|
... started 11:14:18. Current memory use 44.2 MB.
|
Sending messages to paul (2)
|
Failed to send post 34
|
Sent 0 messages with 1 failures
|
... used 21 dbqueries
|
... used 0.03567099571228 seconds
|
Adhoc task failed: mod_forum\task\send_user_notifications,error/Error sending posts.
|
Backtrace:
|
* line 341 of /lib/cronlib.php: call to mod_forum\task\send_user_notifications->execute()
|
* line 198 of /lib/cronlib.php: call to cron_run_inner_adhoc_task()
|
* line 76 of /lib/cronlib.php: call to cron_run_adhoc_tasks()
|
* line 178 of /admin/cli/cron.php: call to cron_run()
|
& subsequently leads to this adhoc task infinitely failing/being requeued (presumably until admin re-enables the provider, at which point all those tasks will run and spam users with every post they would have received since it was disabled)
Seems to be an unintended side effect of MDL-70046
- has been marked as being related by
-
MDL-83217 Failed to send notification... although it is disabled
- Open
-
MDL-78819 Scheduled task send_user_notifications should end trying to send email after some time?
- Closed
-
MDL-79333 Ad-hoc tasks are never deleted despite repeated fails
- Closed
- is a regression caused by
-
MDL-70046 If mail server connection fails forum notification task does not fail
- Closed
- will be (partly) resolved by
-
MDL-79128 Tasks: Implement no-retry flag for ad-hoc tasks and clean up records of historical failed tasks
- Closed
-
MDL-79130 Tasks: Ad-hoc tasks shouldn't retry after max fail delay
- Closed