Cannot send emails - cron job is hanging
Hi,
When I am trying to send out emails, the cron process freezes without actually sending anything. I did some debugging and found that the process (scheduled.php) is getting stuck while doing multithreaded cURL (Lines 231 – 258 in includes/helpers/class.amazonses.php). We run Sendy off AWS instance. PHP version 5.3.18.
Can you please help us with this issues? It's a holiday season and we do need to start emailing customers ASAP.
-- Aleksey
When I am trying to send out emails, the cron process freezes without actually sending anything. I did some debugging and found that the process (scheduled.php) is getting stuck while doing multithreaded cURL (Lines 231 – 258 in includes/helpers/class.amazonses.php). We run Sendy off AWS instance. PHP version 5.3.18.
Can you please help us with this issues? It's a holiday season and we do need to start emailing customers ASAP.
-- Aleksey
This discussion has been closed.
Comments
Also, how many emails are you sending to? What is your send rate and what tier are you on?
Thanks.
What I mean is the following:
From UI, it looks like the campaign quickly (once the cron job starts running) gets into "sending" state, and stays in it forever (well, for more than an hour). Since I am trying to send a test batch to 10 recipients, this time seemed to me wrong, and I tried launching the cron script manually. It never ended. Then I opened your source (I am a PHP developer myself), and added several debug echo statements, which showed me that the script loops forever in class.amazonses.php. We are on production tier, daily quota 10,000 emails, 5 emails/sec.
Are you using Apache/Linux? Some used Ubuntu and was able to work as well.
$q2 = 'SELECT id, query_str, subscriber_id FROM queue WHERE campaign_id = '.$this->CampaignID.' LIMIT '.$ses_send_rate;
to:
$q2 = 'SELECT id, query_str, subscriber_id FROM queue WHERE campaign_id = '.$this->CampaignID.' LIMIT '.($ses_send_rate -1 );
Oh, and, BTW, I found some more bugs in Sendy. Let me know if you are interested
I just launched an Amazon AMI micro instance with Apache/Linux and installed Sendy on it. I had exactly the same issue as you, curl_multi_select always returning -1. The PHP version is 5.3.18.
I then checked my other Sendy installation on MediaTemple with PHP version 5.3.5, curl_multi_select returns the correct number of threads.
I searched the web for this issue and found that others were having similar issue with curl_multi_select always returning -1 with PHP 5.3.18:
http://grokbase.com/t/php/php-bugs/12b12ps1dy/php-bug-bug-63411-new-curl-multi-select-returns-invalid-value
https://bugs.php.net/bug.php?id=63411
https://bugs.php.net/bug.php?id=61141
https://bugs.php.net/bug.php?id=42020
Yes, let the script sleep for 100 milliseconds when curl_multi_select fails - works.
I've updated the current build on http://sendy.co/get-updated
Thanks and sorry that you have to discover this. My kudos to you for your unrelentless quest in nailing down the issue.