Multiple email messages - Moodle 3.9 - mdl_notifications

Multiple email messages - Moodle 3.9 - mdl_notifications

by Augusto Villa -
Number of replies: 3
Picture of Particularly helpful Moodlers

Good morning comrades, I had a problem after updating to version 3.9, from that moment the platforms randomly send multiple emails of the same post. 

I could not find any log, which tells me what the problem may be. Does anyone think of what might be the reason or where to check?

Tanck you!!


Average of ratings: -
In reply to Augusto Villa

Re: Multiple email messages - Moodle 3.9 - mdl_notifications

by Camilo Ravelo Durán -
Hello, did you manage to fix the problem? I read in a forum that it may be because of the server time settings:

https://moodle.org/mod/forum/discuss.php?d=389904
In reply to Camilo Ravelo Durán

Re: Multiple email messages - Moodle 3.9 - mdl_notifications

by Augusto Villa -
Picture of Particularly helpful Moodlers
The problem persists, I compared the LOCALE of two identical servers and collation database and LOCALE of the database server.
They are all the same. but whoever upgrades from moodle keeps sending random duplicate emails.

This is the LOCALE
LANG=es_CL.UTF-8
LC_CTYPE="es_CL.UTF-8"
LC_NUMERIC="es_CL.UTF-8"
LC_TIME="es_CL.UTF-8"
LC_COLLATE="es_CL.UTF-8"
LC_MONETARY="es_CL.UTF-8"
LC_MESSAGES="es_CL.UTF-8"
LC_PAPER="es_CL.UTF-8"
LC_NAME="es_CL.UTF-8"
LC_ADDRESS="es_CL.UTF-8"
LC_TELEPHONE="es_CL.UTF-8"
LC_MEASUREMENT="es_CL.UTF-8"
LC_IDENTIFICATION="es_CL.UTF-8"
LC_ALL=

I think I have a hypothesis. when the process of sending emails is delayed and it runs simultaneously with the next minute, it makes a new sending.
looking at the back of the 2 cron in both I send the same forums.

CRON 1:
Execute scheduled task: Correos del foro y trabajos de mantenimiento (mod_forum\task\cron_task)
... started 19:36:01. Current memory use 36.3MB.
Removing old digest records from 7 days ago.
Removed all old digest records.
Fetching unmailed posts.
Done
Processing post information
Processed 36 posts
Filling caches
Filling course cache
Done
Filling forum cache
Done
Filling discussion cache
Done
Filling user subscription cache
Done
Filling digest cache
Done
All caches filled
Queueing user tasks.
Processing 4 users
Queued 0 digests and 36 messages for 39553
Queued 0 digests and 36 messages for 42
Queued 0 digests and 36 messages for 3637
Queued 0 digests and 36 messages for 13961
Queued 0 digests, and 4 individual tasks for 144 post mails. Unique users: 4 (0 ignored)
All tasks queued.
... used 21 dbqueries
... used 0.040299892425537 seconds
Scheduled task complete: Correos del foro y trabajos de mantenimiento (mod_forum\task\cron_task)
Execute adhoc task: mod_forum\task\send_user_notifications
... started 19:36:01. Current memory use 37.7MB.
Sending messages to 238600464 (39553)
Post 23750 sent
Post 23751 sent
...
CRON 2:
Scheduled task complete: Background processing for scheduled allocation (workshopallocation_scheduled\task\cron_task)
Execute adhoc task: mod_forum\task\send_user_notifications
... started 19:36:11. Current memory use 33.2MB.
Sending messages to augusto (42)
Post 23750 sent
Post 23751 sent
.....
Average of ratings: Useful (1)
In reply to Augusto Villa

Re: Multiple email messages - Moodle 3.9 - mdl_notifications

by Augusto Villa -
Picture of Particularly helpful Moodlers
Good afternoon, I was doing some more tests, the attendance is limited to task-adhoc.
what happens is that when the ad-hoc stack mainly sends mail, when cron runs the next time they start executing the same tasks on the stack simultaneously. if the delay is even longer and the cron runs very frequently, many ad-hoc can be executed simultaneously.
the problem is not the simultaneity but the concurrence on the same tasks.

The same ID from the mdl_task_adhoc table is executed for each cron generating duplicate submissions.

create a Moodle Tracker: https://tracker.moodle.org/browse/MDL-69725
Average of ratings: Useful (1)