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
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | simplenews.361920.patch | 1.42 KB | sutharsan |
| #4 | spool.patch | 795 bytes | 1st-angel |
| update.patch | 1012 bytes | 1st-angel |
Comments
Comment #1
sutharsan commentedThis 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.
Comment #2
1st-angel commentedhi,
could you please specify your concerns about the method call.
thanks
angel
Comment #3
sutharsan commentedUse
simplenews_update_spool(array($key), SIMPLENEWS_SPOOL_SEND);andleave simplenews_update_spool()unchanged.Comment #4
1st-angel commentedhi,
i reworked the patch.
Comment #5
1st-angel commentedstatus change to reflect status.
Comment #6
sutharsan commented@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.
Comment #7
sutharsan commentedI've reworked the patch and committed the attached version. Other changes to the mailing system will be handled in #338015: Improve simplenews throttle.