hi,
my problem ist that my provider does not use max_execution_time for maximal execution time but checks the real processor time of the process. This means that max_execution_time is very (default is 50000) high but the process is killed when it used the processor for 10 seconds (e.g. 100 seconds of 10% CPU-usage ). This way the test for $elapsed > SIMPLENEWS_SEND_TIME_LIMIT * ini_get('max_execution_time') does not work and the foreach is not left. After a while the while is interrupted by killing the process. This results in the fact that simplenews_update_spool is not run and mails are send out over and over again.
My patch changes simplenews.module so it updates simplenews_mail_spool after each send e-mail. This decrease performance a bit but I don't see other ways to fix this problem.
Talking my provider in changeing his policy is not a option as it is one of the biggest providers in germany (1&1) and I think the don't use that policy without thinking about it.

Thanks
Angel

CommentFileSizeAuthor
#7 simplenews.361920.patch1.42 KBsutharsan
#4 spool.patch795 bytes1st-angel
update.patch1012 bytes1st-angel

Comments

sutharsan’s picture

Category: bug » feature
Status: Needs review » Needs work

This way it will only solve half of the problem. We should also prevent the php process from being killed, i.e. introduce a setting for max execution time which will replace the static SIMPLENEWS_SEND_TIME_LIMIT * ini_get('max_execution_time').
An other solution is a throttle method I described here.

You need to rework the original patch too. Calling simplenews_update_spool($key, SIMPLENEWS_SPOOL_SEND); this is not good coding practice.

Currently you should reduce the batch size to prevent duplicate emails.

1st-angel’s picture

hi,
could you please specify your concerns about the method call.
thanks
angel

sutharsan’s picture

Use simplenews_update_spool(array($key), SIMPLENEWS_SPOOL_SEND); and leave simplenews_update_spool() unchanged.

1st-angel’s picture

StatusFileSize
new795 bytes

hi,
i reworked the patch.

1st-angel’s picture

Status: Needs work » Needs review

status change to reflect status.

sutharsan’s picture

Status: Needs review » Needs work

@1st-angel: If you make a patch I expect the patch to be complete without any loose ends. Yes, in this case it would be a no-brainer to me to do it myselve, but I hope it is better to help you to do it.

you should place the simplenews_update_spool() call inside the preceding if statement and remove the unnecessary code. Also you should update the comments if you change the code.

Further, as I described at #1, this solves only half of the problem. You need to change the limiter and add an admin setting.

sutharsan’s picture

Category: feature » bug
Status: Needs work » Fixed
StatusFileSize
new1.42 KB

I've reworked the patch and committed the attached version. Other changes to the mailing system will be handled in #338015: Improve simplenews throttle.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.