Notification email delay

Forum News, Announcements and any issues you're having with the forum

Moderator: myglaren

User avatar
xantia_v6
Forum Admin Team
Posts: 7908
Joined: 09 Nov 2005, 23:03
x 512

Re: Notification email delay

Post by xantia_v6 »

The notification delay is fixed for now, but I think that it may come back, it is not clear what is going on with the database lock, but we shall see.
User avatar
mickthemaverick
Donor 2021
Posts: 7386
Joined: 11 May 2019, 17:56
x 2095

Re: Notification email delay

Post by mickthemaverick »

Thanks Mike, it is working properly at the moment as is evidenced by this response. Well done !! :) :) :)
User avatar
mickthemaverick
Donor 2021
Posts: 7386
Joined: 11 May 2019, 17:56
x 2095

Re: Notification email delay

Post by mickthemaverick »

Sorry to say no notifications as yet from the last 5 posts which have gone on!! :cry:
Hell Razor5543
Donor 2021
Posts: 12014
Joined: 01 Apr 2012, 09:47
x 1513

Re: Notification email delay

Post by Hell Razor5543 »

mickthemaverick wrote:
19 Jul 2020, 17:33
Sorry to say no notifications as yet from the last 5 posts which have gone on!! :cry:
Ah, that is to save postage costs. The system waits until there are enough emails to get a job lot discount, and then dispatches them to you.
User avatar
mickthemaverick
Donor 2021
Posts: 7386
Joined: 11 May 2019, 17:56
x 2095

Re: Notification email delay

Post by mickthemaverick »

Just had 10 emails 5 mins after Steve posted ! :(
User avatar
xantia_v6
Forum Admin Team
Posts: 7908
Joined: 09 Nov 2005, 23:03
x 512

Re: Notification email delay

Post by xantia_v6 »

I have a theory that we have run into a bug or design flaw in the form software that has been exposed by changing to a different web server package.

I will live with this problem for a few days while trying to track down the root cause.
User avatar
xantia_v6
Forum Admin Team
Posts: 7908
Joined: 09 Nov 2005, 23:03
x 512

Re: Notification email delay

Post by xantia_v6 »

While browsing the forum source code looking for potential problems, i did find what appears to be a bug.
I have made a small correction to it and we are now testing the results.
User avatar
GiveMeABreak
Forum Admin Team
Posts: 26065
Joined: 15 Sep 2015, 19:38
x 2992

Re: Notification email delay

Post by GiveMeABreak »

Have you checked the task queue setting?

To ensure notification emails go out immediately while still making use of the task queue, set the configuration parameter "queue_interval" to 0. Also ensure email package size is set to a very large number.

The queue_interval parameter is not accessible via the Administration Control Panel or anywhere else in the web interface. You'll have to set it directly in the database's config table.

But contrary to the above, the support Team commented that "If you set the Email Package Size to zero on the Email Settings page, phpBB does not queue up the emails."

https://www.phpbb.com/community/viewtopic.php?t=2164504"
User avatar
xantia_v6
Forum Admin Team
Posts: 7908
Joined: 09 Nov 2005, 23:03
x 512

Re: Notification email delay

Post by xantia_v6 »

Yes I have investigated the settings and have chosen values which should work, although I think that the overall algorithm could be improved a little.

The bug that I spotted above however means that the algorithm has never (at least for the past 4 years) worked as intended, as most of the time the email queue was locked, just occasionally being unlocked to send out a bunch of queued emails.
User avatar
xantia_v6
Forum Admin Team
Posts: 7908
Joined: 09 Nov 2005, 23:03
x 512

Re: Notification email delay

Post by xantia_v6 »

The problem is evidently still present and is definitely a problem with the cron_lock. I will take a look at it tonight, unfortunately this bug only seems to be visible on the live forum, so is a bit tricky to track down.
Hell Razor5543
Donor 2021
Posts: 12014
Joined: 01 Apr 2012, 09:47
x 1513

Re: Notification email delay

Post by Hell Razor5543 »

Alright, who has pinched/lost the key to the email queue?
User avatar
xantia_v6
Forum Admin Team
Posts: 7908
Joined: 09 Nov 2005, 23:03
x 512

Re: Notification email delay

Post by xantia_v6 »

I believe that the problem is now fixed. I did find a couple of instances of inappropriate coding in the forum software, but I have to put my hand up and say that the actual cause of the problem was a piece of code that I wrote in a new security plugin that I installed a couple of weeks ago.

It was not connected with the server software reconfiguration that I started a few days ago. The faulty code was not even part of the mail delivery system, it just happened to share the same background task lock.
User avatar
mickthemaverick
Donor 2021
Posts: 7386
Joined: 11 May 2019, 17:56
x 2095

Re: Notification email delay

Post by mickthemaverick »

Brilliant Mike, nothing beats actually finding a cause. Have a beer on me Cheers